package.yml - VirtualBox - Lazarus (#132)

Signed-off-by: Pierre-Yves <pyu@riseup.net>
This commit is contained in:
Pierre-Yves 2018-04-20 14:50:56 +02:00 committed by Joshua Strobl
parent 7164e42c29
commit cb79b6860b
7 changed files with 101 additions and 139 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

0
imgs/software/virtualbox/vbox-kernel.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -1,12 +1,12 @@
+++
title = "Package.yml"
lastmod = "2017-09-27T15:32:14+03:00"
lastmod = "2018-04-19T19:31:14+02:00"
+++
# Package.yml
All packages consist of a single build file, which provides all of the required metadata for the package manager, plus the build steps involved to produce a package. This follows the YAML specification.
## Format
## Format
All `package.yml` files **must** be valid YAML.
@ -18,33 +18,37 @@ An example file follows:
``` yaml
name : nano
version : 2.5.1
release : 39
version : 2.9.5
release : 96
source :
- http://www.nano-editor.org/dist/v2.5/nano-2.5.1.tar.gz : e06fca01bf183f4d531aa65a28dffc0e2d10185239909eb3de797023f3453bde
license : GPL-3.0
component : editor
- https://www.nano-editor.org/dist/v2.9/nano-2.9.5.tar.xz : 7b8d181cb57f42fa86a380bb9ad46abab859b60383607f731b65a9077f4b4e19
license : GPL-3.0-or-later
summary : Small, friendly text editor inspired by Pico
component : system.devel
description: |
GNU nano is an easy-to-use text editor originally designed as a replacement for
Pico, the ncurses-based editor from the non-free mailer package Pine.
GNU nano is an easy-to-use text editor originally designed as a replacement for Pico, the ncurses-based editor from the non-free mailer package Pine (itself now available under the Apache License as Alpine).
setup : |
%configure --enable-utf8 --docdir=/usr/share/doc/nano
%patch -p1 < $pkgfiles/0001-Use-a-stateless-configuration.patch
%reconfigure --enable-utf8 --docdir=/usr/share/doc/nano
build : |
%make
install : |
%make_install
# TODO: Convert to stateless
install -D -m 00644 $pkgfiles/nanorc $installdir/etc/nanorc
install -D -m 00644 $pkgfiles/nanorc $installdir/usr/share/defaults/nano/nanorc
install -D -m 00644 $pkgfiles/git.nanorc $installdir/usr/share/nano/git.nanorc
# https://github.com/scopatz/nanorc
for rcFile in $pkgfiles/nanorc-extras/*.nanorc; do
install -m 00644 $rcFile $installdir/usr/share/nano
done
```
## Keys
## Keys
Not all fields in `package.yml` are mandatory, but a small selection are. They are listed below. Note that `string(s)` indicates that it is possible to use a `list` of strings, or one single `string`
`dict` refers to a `key : value` split in YAML, and `dict(s)` refers to a list of `dict`s
### Mandatory Keys
### Mandatory Keys
Key Name | Type | Description
---- | ---- | ----
@ -57,7 +61,7 @@ Key Name | Type | Description
**summary** | `string` | Brief package summary, or display name
**description** | `string` | More extensive description of the software, usually taken from the vendor website
### Optional, supported keys
### Optional, supported keys
Key Name | Type | Description
---- | ---- | ----
@ -71,7 +75,7 @@ Key Name | Type | Description
**replaces** | `dict(s)` | Replace one package with another, used when renaming or deprecating packages for clean upgrade paths
**patterns** | `dict(s)` | Allows fine grained control over file placement within the package or sub-packages. Useful for packages that are development only (i.e. `/usr/bin` files)
### Build step keys, optional
### Build step keys, optional
Note that each step in itself is optional, however all can be used. The value of each of these keys is merged into a build script that is executed for each stage of the build.
@ -82,12 +86,11 @@ Step Name | Description
**install** | This is where you should install the files into the final packaging directory, i.e. `make install`
**check** | There is where tests / checking should occur, i.e. `make check`
## Macros
## Macros
To further assist in packaging, a number of macros are available. These are simply shorthand ways to perform a normal build operation. They also ensure that the resulting package is consistent. These macros are only available in our build steps, as
they are substituted within the script before execution.
To further assist in packaging, a number of macros are available. These are simply shorthand ways to perform a normal build operation. They also ensure that the resulting package is consistent. These macros are only available in our build steps, as they are substituted within the script before execution.
### Usage
### Usage
Macros are prefixed with `%`, and are substituted before your script is executed. Macros ending with `%` are used to provide directory names or build values, to the script.
@ -96,12 +99,13 @@ Macros are prefixed with `%`, and are substituted before your script is executed
%configure --disable-static
```
### Actionable Macros
### Actionable Macros
Macro | Description
---- | ----
**%autogen** | Runs autogen with our `%CONFOPTS%` to create a configure script then proceeds to run `%configure`.
**%cmake** | Configure cmake project with the distribution specific options, such as prefix and release type
**%cmake** | Configure cmake project with the distribution specific options, such as prefix and release type.
**%cmake_ninja** | Configure cmake project with ninja so it can be used with `%ninja_build`, `%ninja_install` and `%ninja_check` macros.
**%configure** | Runs `./configure` with our `%CONFOPTS%` variable macro.
**%make** | Runs the `make` command with the job count specified in `eopkg.conf`
**%make_install** | Perform a `make install`, using the `DESTDIR` variant. Should work for the vast majority of packages.
@ -118,15 +122,16 @@ Macro | Description
**%cabal_install** | Runs cabal copy to `$installdir`
**%cabal_register** | Runs cabal register to generate a pkg-config for package and version, then installs the conf file.
### Meson Actionable Macros
### Ninja Actionable Macros
Macro | Description
---- | ----
**%meson_configure** | Runs meson with our CFLAGS and appropriate flags such as libdir.
**%meson_build** | Runs ninja and passes our `%JOBS%` variable.
**%meson_install** | Runs meson install and passed the appropriate `DESTDIR` and `%JOBS%` variable
**%ninja_build** | Runs ninja and passes our `%JOBS%` variable. This macro obsoletes *%meson_build*.
**%ninja_install** | Runs meson install and passed the appropriate `DESTDIR` and `%JOBS%` variable. This macro obsoletes *%meson_install*.
**%ninja_check** | Runs ninja test and passes our `%JOBS%` variable. This macro obsoletes *%meson_check*.
### Perl Actionable Macros
### Perl Actionable Macros
Macro | Description
---- | ----
@ -134,7 +139,7 @@ Macro | Description
**%perl_build** | Runs Perl build scripts or attempts `%make`.
**%perl_install** | Runs Perl install scripts or attempts `%make_install`.
### Python Actionable Macros
### Python Actionable Macros
Macro | Description
---- | ----
@ -143,6 +148,13 @@ Macro | Description
**%python3_setup** | Runs the build portion of a setup.py using python3.
**%python3_install** | Runs the install portion of a setup.py, to the appropriate root, using python3.
### Ruby Actionable Macros
Macro | Description
---- | ----
**%gem_build** | Runs gem build.
**%gem_install** | Runs gem install with the appropriate parameters.
### Qt Actionable Macros
Macro | Description
@ -150,25 +162,35 @@ Macro | Description
**%qmake** | Runs qmake for Qt5 with the appropriate make flags.
**%qmake4** | Runs qmake for Qt4, as well as adding the necessary MOC, RCC, and UIC flags since those Qt4 executables end in -qt4.
### Variable Macros
### Waf Actionable Macros
Macro | Description
---- | ----
**%waf_configure** | Runs waf configure with prefix.
**%waf_build** | Runs waf and passes our `%JOBS%` variable.
**%waf_install** | Runs waf install and passed the appropriate `destdir` and `%JOBS%` variable
### Variable Macros
Macro | Description
---- | ----
**%ARCH%** | Indicates the current build architecture.
**%CC%** | C compiler
**%CFLAGS%** | cflags as set in `eopkg.conf`
**%CONFOPTS%** | Flags / options for configuration, such as `--prefix=/usr`. [Full List.](https://github.com/solus-project/ypkg/blob/master/ypkg2/rc.yml#L127-L130)
**%CONFOPTS%** | Flags / options for configuration, such as `--prefix=%PREFIX%`. [Full List.](https://github.com/solus-project/ypkg/blob/master/ypkg2/rc.yml#L230-L233)
**%CXX%** | C++ compiler
**%CXXFLAGS%** | cxxflags as set in `eopkg.conf`
**%JOBS%** | jobs, as set in `eopkg.conf`
**%LDFLAGS%** | ldflags as set in `eopkg.conf`
**%LIBSUFFIX%** | Library suffix (either 32 for 32-bit or 64 for 64-bit)
**%PREFIX%** | Hard-coded prefix `/usr`
**%YJOBS%** | Job count without `-j` as set in `eopkg.conf`
**%installroot%** | Hard-coded install directory
**%libdir%** | The distributions default library directory, i.e. `/usr/lib64` (Alters for `emul32`)
**%version%** | Version of the package, as specified in the version key.
**%workdir%** | Hard-coded work directory (source tree)
## Variables
## Variables
A set of variables are exported in our build stages. These are used to provide context and structure to the scripts.
@ -180,24 +202,24 @@ Variable | Description
**$CC** | C compiler
**$CXX** | C++ compiler
**$EMUL32BUILD** | Set only when compiling in `emul32` mode
**$workdir** | The work, or source, directory of the package build
**$installdir** | The install directory, i.e. where files are installed to for packaging
**$pkgfiles** | Refers to the `./files` directory relative to the `package.yml` file
**$sources** | Refers to the directory where your source files are stored e.g. `$sources/nano.tar.gz`
**$workdir** | The work, or source, directory of the package build
## Types
## Types
The `package.yml` file uses native YAML types, however for the sake of clarity an explanation of how they are used within the context of `ypkg` is provided below.
### string
### string
This is simply text, which does not need to be quoted.
### integer
### integer
Whole, positive number, used in the `release` field.
### list
### list
A YAML list (or array) can be expressed in multiple ways. A short array-notation would look like this:
@ -211,7 +233,7 @@ They can also be expressed like this:
- Third Value
```
### dict
### dict
Known as an associative array, this is key to value mapping. These are separated by a colon (`:`), the token on the left is taken to be a key, and the token on the right is the value.
@ -219,7 +241,7 @@ Known as an associative array, this is key to value mapping. These are separated
Note that each `ypkg key` in the YAML file is actually a dict.
### dict(s)
### dict(s)
This is a combination of the `list` type, the `dict` type and some assumptions. We primarily make use of this to express advanced information within the package. These permit you to provide no key, and a value only.
In this instance, the key is assumed to be the package `name`:

View File

@ -1,36 +0,0 @@
+++
title = "Lazarus IDE"
lastmod = "2017-07-22T14:44:58+03:00"
+++
# Lazarus IDE
[Lazarus](https://www.lazarus-ide.org/) is a Delphi compatible cross-platform IDE for Rapid Application Development. It has variety of components ready for use and a graphical form designer to easily create complex graphical user interfaces.
## Getting Started
Make sure you have the necessary packages installed:
``` bash
sudo eopkg upgrade
sudo eopkg install lazarus
```
### Installing FPC Source
First, determine the version of `fpc` that you have installed:
``` bash
fpc -h
```
Now go to [FreePascal on SourceForge](https://sourceforge.net/projects/freepascal/files/Source/) and download the corresponding archive `fpc-<version>.source.tar.gz`.
Once you have the archive, unpack it into a directory of your choosing by using either the `tar` command or a graphical program. This tutorial uses `~/Development/fpc-3.0.2` to store the source files.
Now that you have the source files, open **Lazarus IDE**. You should be presented with a window like this one:
{{< altimg "lazarus_config.png" "help-center/software/lazarus/" >}}
From the ***FPC Sources*** tab, ***Browse*** to the directory where you unpacked the source. Confirm your selection and then press ***Start IDE***.
That's it! You are now ready to use Lazarus IDE to develop GUI applications.

View File

@ -1,12 +1,35 @@
+++
title = "VirtualBox"
lastmod = "2018-02-24T22:30:00+02:00"
lastmod = "2018-04-19T19:30:00+02:00"
+++
# VirtualBox
[VirtualBox](https://virtualbox.org) is an x86 virtualization software package developed by Oracle.
[VirtualBox](https://virtualbox.org) is an x86 and x86_64 virtualization software package developed by Oracle.
## Determine which kernel you are using
## Before you start
This section applies to new installations for both **Host** and **Guest**.
### Remove prior installation
It is important to uninstall any version of VirtualBox (or VirtualBox Guest Additions) that **was not** installed from the Software Center or there will be conflicts that will prevent the application to work.
This can usually be done by executing the following command from a terminal:
``` bash
sudo /opt/VirtualBox/uninstall.sh
```
### Update your system
Ensure your system is up-to-date. This is very important because VirtualBox installs some kernel modules and the application will not work if your kernel is outdated.
``` bash
sudo eopkg upgrade
```
### Determine which kernel you are using
Solus support both a `current` and `lts` kernel. It is important to install the version that corresponds to your kernel.
@ -16,7 +39,8 @@ If you aren't sure which kernel you are running, run the following in terminal:
uname -r
```
You will either have a `.current` or `.lts` suffix. Examples: `4.13.12-32.current` or `4.9.61-57.lts`
You will either have a `.current` or `.lts` suffix. Examples: `4.15.15-63.current` or `4.9.92-85.lts`
## Solus as Host
@ -24,9 +48,9 @@ VirtualBox is available in the Software Center, select the package that matches
virtualbox | virtualbox-current
----- | -----
VirtualBox modules for the **linux-lts** kernel | VirtualBox modules for the **linux-current** kernel
VirtualBox Host modules for the **linux-lts** kernel | VirtualBox Host modules for the **linux-current** kernel
You **must** reboot your computer before running VirtualBox for the first time
You **must** reboot your computer before running VirtualBox for the first time.
### Troubleshooting
@ -37,73 +61,24 @@ The Error `Kernel driver not installed (rc=-1908)` may occur if
- The computer was not restarted before launching VirtualBox for the first time
- The computer is not booted on the latest kernel. Make sure to apply the updates from the Software Center and restart your machine.
- The wrong VirtualBox package was installed. Please check the instructions just above to install the correct package for your kernel.
- VirtualBox was manually installed and it conflicts with the version installed from the Solus Repository. The below commands usually help solving this last problem.
- VirtualBox was manually installed and it conflicts with the version installed from the Solus Repository.
``` bash
sudo /opt/VirtualBox/uninstall.sh
eopkg li | grep virtualbox | awk '{print $1}' | xargs sudo eopkg it --reinstall
sudo reboot
```
## Solus as Guest
### Preparing your system
Before you start, ensure your all packages are up-to-date on the virtual machine
VirtualBox Guest Additions are available in the Software Center, select the package that matches kernel version on the Solus virtual machine.
``` bash
sudo eopkg upgrade
```
virtualbox-guest | virtualbox-guest-current
----- | -----
VirtualBox Guest modules for the **linux-lts** kernel | VirtualBox Guest modules for the **linux-current** kernel
For using VirtualBox, it is important to install the correct headers for your kernel
You **must** reboot your virtual machine to load the newly installed modules
If you have a **lts** kernel, install the lts headers
``` bash
sudo eopkg install linux-lts-headers
```
If you have a **current** kernel, installing the current headers
``` bash
sudo eopkg install linux-current-headers
```
Make sure you have the necessary packages installed
``` bash
sudo eopkg install gcc make autoconf binutils xorg-server-devel libelf-devel
```
Reboot the virtual machine.
### Install the Guest Additions
Now install the **Guest Additions** : from the VirtualBox menu `Devices` -> `Insert Guest Additions CD image...`
On the guest Machine, open `Files` and click on the optical drive icon (CD name starts with VBOXADDITIONS) then click on the `Run Software` button and follow the on screen instructions.
{{< altimg "autorun.png" "help-center/software/virtualbox/" >}}
**Note:** For each kernel update you will need to rebuild the VirtualBox Modules. So simply remount the ISO and run the instructions again.
### Virtual machine settings
Here is a brief overview on some options you may want to set (you can only do it when your virtual machine is not running).
Select your guest machine and click on the Settings icon.
#### Clipboard Sharing, Drag & Drop
By default, Clipboard Sharing and Drag'n'Drop are disabled, you can change this in `General` -> `Advanced`
{{< altimg "vbox-clipboard.png" "help-center/software/virtualbox/" >}}
#### Number of CPU
Virtual machines are created with only 1 CPU. You can change this in
`System` -> `Processor`
#### 3D Acceleration
For better performances, it is strongly recommended to enable 3D Acceleration in `Display` -> `Screen`
## Extra configuration
#### USB Controller
If you have installed the [extension pack](https://www.virtualbox.org/manual/ch01.html#intro-installing) and your hardware supports it, you set the USB Controller to USB 2.0 or 3.0, in `USB`
If you want to use USB 2.0 or 3.0 in your virtual machine (and your hardware supports it), you have to install the [extension pack](https://www.virtualbox.org/manual/ch01.html#intro-installing).
Note: Access to USB is granted by the user group `vboxusers` on the **Host** operating system. You can add yourself to this group with the following command
@ -112,12 +87,13 @@ sudo usermod -aG vboxusers `whoami`
```
#### Shared Folders
You can share folders from the Host to the Guest in `Shared Folders`
Share folders let you access files from the host system from within a guest machine.
**Note:** auto-mounted shared folders are mounted into the `/media` directory, along with the prefix `sf_`. For example, the shared folder `myfiles` would be mounted to `/media/sf_myfiles`. Access to auto-mounted shared folders is only granted to the user group `vboxsf` on the Guest operating system.
**Note:** auto-mounted shared folders are mounted into the `/media` directory, along with the prefix `sf_`. For example, the shared folder `myfiles` would be mounted to `/media/sf_myfiles`.
Access to the shared folders is only granted to the user group `vboxsf` on the **Guest** operating system.
Execute these commands to set the permissions and add yourself to the group
``` bash
sudo chmod 755 /media
sudo usermod -aG vboxsf `whoami`
```