ostree: enable ed25519 support

This was omitted in the latest update.

Only adds ~400 KB.

It required adding openssl to tests so I tacked on some cleanups.
In particular, the GI_TYPELIB_PATH was already being set in the wrapper
so we can remove it from the module (not sure why Gtk was even there).

Also switched away from using pkgconfig and docbook_xsl aliases
and reordered the expression a bit.
This commit is contained in:
Jan Tojnar 2020-07-25 10:43:31 +02:00
parent 9f771202c1
commit 352749e577
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
3 changed files with 42 additions and 19 deletions

View File

@ -3,21 +3,10 @@
makeInstalledTest { makeInstalledTest {
tested = pkgs.ostree; tested = pkgs.ostree;
# TODO: Wrap/patch the tests directly in the package
testConfig = { testConfig = {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(python3.withPackages (p: with p; [ pyyaml ]))
gnupg gnupg
ostree ostree
]; ];
# for GJS tests
environment.variables.GI_TYPELIB_PATH = lib.makeSearchPath "lib/girepository-1.0" (with pkgs; [
gtk3
pango.out
ostree
gdk-pixbuf
atk
]);
}; };
} }

View File

@ -2,7 +2,7 @@
, fetchurl , fetchurl
, fetchpatch , fetchpatch
, substituteAll , substituteAll
, pkgconfig , pkg-config
, gtk-doc , gtk-doc
, gobject-introspection , gobject-introspection
, gjs , gjs
@ -21,13 +21,15 @@
, fuse , fuse
, utillinuxMinimal , utillinuxMinimal
, libselinux , libselinux
, libsodium
, libarchive , libarchive
, libcap , libcap
, bzip2 , bzip2
, yacc , yacc
, libxslt , libxslt
, docbook_xsl , docbook-xsl-nons
, docbook_xml_dtd_42 , docbook_xml_dtd_42
, openssl
, python3 , python3
}: }:
@ -59,6 +61,7 @@ in stdenv.mkDerivation rec {
(substituteAll { (substituteAll {
src = ./fix-test-paths.patch; src = ./fix-test-paths.patch;
python3 = testPython.interpreter; python3 = testPython.interpreter;
openssl = "${openssl}/bin/openssl";
}) })
]; ];
@ -66,14 +69,14 @@ in stdenv.mkDerivation rec {
autoconf autoconf
automake automake
libtool libtool
pkgconfig pkg-config
gtk-doc gtk-doc
gobject-introspection gobject-introspection
which which
makeWrapper makeWrapper
yacc yacc
libxslt libxslt
docbook_xsl docbook-xsl-nons
docbook_xml_dtd_42 docbook_xml_dtd_42
]; ];
@ -85,6 +88,7 @@ in stdenv.mkDerivation rec {
gpgme gpgme
fuse fuse
libselinux libselinux
libsodium
libcap libcap
libarchive libarchive
bzip2 bzip2
@ -96,16 +100,13 @@ in stdenv.mkDerivation rec {
gjs gjs
]; ];
preConfigure = ''
env NOCONFIGURE=1 ./autogen.sh
'';
enableParallelBuilding = true; enableParallelBuilding = true;
configureFlags = [ configureFlags = [
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
"--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators" "--with-systemdsystemgeneratordir=${placeholder "out"}/lib/systemd/system-generators"
"--enable-installed-tests" "--enable-installed-tests"
"--with-ed25519-libsodium"
]; ];
makeFlags = [ makeFlags = [
@ -113,6 +114,10 @@ in stdenv.mkDerivation rec {
"installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/libostree" "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/libostree"
]; ];
preConfigure = ''
env NOCONFIGURE=1 ./autogen.sh
'';
postFixup = let postFixup = let
typelibPath = stdenv.lib.makeSearchPath "/lib/girepository-1.0" [ typelibPath = stdenv.lib.makeSearchPath "/lib/girepository-1.0" [
(placeholder "out") (placeholder "out")

View File

@ -1,3 +1,32 @@
diff --git a/tests/libtest.sh b/tests/libtest.sh
index ca457fa2..c0a529ff 100755
--- a/tests/libtest.sh
+++ b/tests/libtest.sh
@@ -709,12 +709,12 @@ gen_ed25519_keys ()
{
# Generate private key in PEM format
pemfile="$(mktemp -p ${test_tmpdir} ed25519_XXXXXX.pem)"
- openssl genpkey -algorithm ed25519 -outform PEM -out "${pemfile}"
+ @openssl@ genpkey -algorithm ed25519 -outform PEM -out "${pemfile}"
# Based on: http://openssl.6102.n7.nabble.com/ed25519-key-generation-td73907.html
# Extract the private and public parts from generated key.
- ED25519PUBLIC="$(openssl pkey -outform DER -pubout -in ${pemfile} | tail -c 32 | base64)"
- ED25519SEED="$(openssl pkey -outform DER -in ${pemfile} | tail -c 32 | base64)"
+ ED25519PUBLIC="$(@openssl@ pkey -outform DER -pubout -in ${pemfile} | tail -c 32 | base64)"
+ ED25519SEED="$(@openssl@ pkey -outform DER -in ${pemfile} | tail -c 32 | base64)"
# Secret key is concantination of SEED and PUBLIC
ED25519SECRET="$(echo ${ED25519SEED}${ED25519PUBLIC} | base64 -d | base64 -w 0)"
@@ -725,7 +725,7 @@ gen_ed25519_keys ()
gen_ed25519_random_public()
{
- openssl genpkey -algorithm ED25519 | openssl pkey -outform DER | tail -c 32 | base64
+ @openssl@ genpkey -algorithm ED25519 | @openssl@ pkey -outform DER | tail -c 32 | base64
}
is_bare_user_only_repo () {
diff --git a/tests/test-basic-user-only.sh b/tests/test-basic-user-only.sh diff --git a/tests/test-basic-user-only.sh b/tests/test-basic-user-only.sh
index f65094fd..105be893 100755 index f65094fd..105be893 100755
--- a/tests/test-basic-user-only.sh --- a/tests/test-basic-user-only.sh