Browse Source

add guix packagers guide

master
parent
commit
493b9f5979
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 11
      README.md
  2. 159
      content/guix-packagers-guide.rst
  3. 2
      themes/alextee/templates/base.html

11
README.md

@ -1,3 +1,10 @@ @@ -1,3 +1,10 @@
# alextee-web
alextee-web
===========
Source for www.alextee.org
Source for www.alexandrostheodotou.com
# Build
`make html`
# Deploy
`SSH_USER=<user> SSH_HOST=<host> SSH_TARGET_DIR=<target-dir> make rsync_upload`

159
content/guix-packagers-guide.rst

@ -0,0 +1,159 @@ @@ -0,0 +1,159 @@
Guix Packager's Guide
#####################
:date: 2021-01-16 14:54
:tags: packaging
:category: system
:slug: guix-packagers-guide
:authors: Alexandros Theodotou
:summary: Packaging guide for GNU Guix
This is a guide/cheatsheet for writing Guix packages.
Example package definitions file
--------------------------------
.. code-block:: scheme
(define-module (my-packages)
#:use-module (ice-9 fdes-finalizers)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system meson)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (gnu packages)
#:use-module (gnu packages audio)
#:use-module (gnu packages music))
(define-public zlfo
(package
(name "zlfo")
(version "0.1.3")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://git.zrythm.org/git/ZLFO")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
"0bm466ci5xyvxvq7l9p6xyh789lvk6i31b4zja1igqh13akbjnjz"))))
(build-system meson-build-system)
(inputs
`(("librsvg" ,librsvg)
("lv2" ,lv2)
("ztoolkit-rsvg" ,ztoolkit-rsvg)))
(native-inputs
`(("pkg-config" ,pkg-config)))
(synopsis "Low frequency oscillator plugin")
(description "ZLFO is a fully featured
@dfn{low frequency oscillator} (LFO) for @dfn{control voltage} (CV)-based
automation that comes as an LV2 plugin bundle with a custom UI.")
(home-page "https://git.zrythm.org/cgit/ZLFO/")
(license license:agpl3+)))
;; more packages here
The rest of this guide assumes this file is saved as
``my-packages.scm`` under the current dir.
Build a package from definition
-------------------------------
.. code-block:: bash
guix build -L . -K zlfo
* ``-L`` specifies the directory where the package definitions are
* ``-K`` tells guix to keep the temporary build dir if the build fails
Force-rebuild a package
-----------------------
.. code-block:: bash
guix build --check --no-grafts zlfo
Deprecate a package
-------------------
.. code-block:: scheme
(define-public zlfo
;; The "zlfo" package is now included in zplugins
(deprecated-package "zlfo" zplugins))
Use source as input
-------------------
.. code-block:: scheme
(inputs
`(("juce"
,(let ((commit "c51d03f11be20cb35eb28e8016e9a81827b50339"))
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/lv2-porting-project/JUCE")
(commit commit)))
(sha256
(base32 "1mkjbixvp7q1fyz9s7qn152iv6c03gfwjbx32dymcx2jayjlakp4"))
(file-name "juce-src"))))))
Delete a phase
--------------
.. code-block:: scheme
(arguments
`(#:tests? #f ; no "check" target
#:phases
(modify-phases %standard-phases
(delete 'configure))))
Change Make flags
-----------------
.. code-block:: scheme
(arguments
`(#:make-flags
(list "--directory=extras/Projucer/Builds/LinuxMakefile" "CONFIG=Release")))
Copy a file during install
--------------------------
.. code-block:: scheme
(arguments
`(#:phases
(modify-phases %standard-phases
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin")))
(mkdir-p bin)
(copy-file "extras/Projucer/Builds/LinuxMakefile/build/Projucer"
(string-append bin "/Projucer"))))))))
Various procedures
------------------
.. code-block:: scheme
;; setting an env variable
(setenv "GDK_BACKEND" "x11")
;; invoking a command
(invoke "patch" "-N" "Builds/LinuxMakefile/Makefile"
makefile-patch)
Tips
----
1. Libraries should list their ``pkgconfig`` dependencies as
propagated-inputs (see ``librsvg`` for example)

2
themes/alextee/templates/base.html

@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
{% if DISPLAY_FOOTER or DISPLAY_FOOTER is not defined %}
<footer>
<p>
Copyright &copy; 2019 Alexandros Theodotou | <a href="{{ SITEURL }}/license.html">Licenses</a>
Copyright &copy; 2019, 2021 Alexandros Theodotou | <a href="{{ SITEURL }}/license.html">Licenses</a>
</p>
</footer>
{% endif %}

Loading…
Cancel
Save