Merge pull request #222781 from wegank/sogo-hotfix
sope: make build less illegal
This commit is contained in:
commit
1fbcd656e9
|
@ -1,4 +1,4 @@
|
||||||
{ gnustep, lib, fetchFromGitHub , libxml2, openssl
|
{ gnustep, lib, fetchFromGitHub, fetchpatch, libxml2, openssl
|
||||||
, openldap, mariadb, libmysqlclient, postgresql }:
|
, openldap, mariadb, libmysqlclient, postgresql }:
|
||||||
|
|
||||||
gnustep.stdenv.mkDerivation rec {
|
gnustep.stdenv.mkDerivation rec {
|
||||||
|
@ -12,20 +12,36 @@ gnustep.stdenv.mkDerivation rec {
|
||||||
hash = "sha256-sXIpKdJ5930+W+FsxQ8DZOq/49XWMM1zV8dIzbQdcbc=";
|
hash = "sha256-sXIpKdJ5930+W+FsxQ8DZOq/49XWMM1zV8dIzbQdcbc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
name = "sope-no-unnecessary-vars.patch";
|
||||||
|
url = "https://github.com/Alinto/sope/commit/0751a2f11961fd7de4e2728b6e34e9ba4ba5887e.patch";
|
||||||
|
hash = "sha256-1txj8Qehg2N7ZsiYQA2FXI4peQAE3HUwDYkJEP9WnEk=";
|
||||||
|
})
|
||||||
|
(fetchpatch {
|
||||||
|
name = "sope-fix-wformat.patch";
|
||||||
|
url = "https://github.com/Alinto/sope/commit/6adfadd5dd2da4041657ad071892f2c9b1704d22.patch";
|
||||||
|
hash = "sha256-zCbvVdbeBeNo3/cDVdYbyUUC2z8D6Q5ga0plUoMqr98=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
nativeBuildInputs = [ gnustep.make ];
|
nativeBuildInputs = [ gnustep.make ];
|
||||||
buildInputs = lib.flatten ([ gnustep.base libxml2 openssl ]
|
buildInputs = [ gnustep.base libxml2 openssl ]
|
||||||
++ lib.optional (openldap != null) openldap
|
++ lib.optional (openldap != null) openldap
|
||||||
++ lib.optionals (mariadb != null) [ libmysqlclient mariadb ]
|
++ lib.optionals (mariadb != null) [ libmysqlclient mariadb ]
|
||||||
++ lib.optional (postgresql != null) postgresql);
|
++ lib.optional (postgresql != null) postgresql;
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
# Exclude NIX_ variables
|
|
||||||
sed -i 's/grep GNUSTEP_/grep ^GNUSTEP_/g' configure
|
|
||||||
'';
|
|
||||||
|
|
||||||
|
# Configure directories where files are installed to. Everything is automatically
|
||||||
|
# put into $out (thanks GNUstep) apart from the makefiles location which is where
|
||||||
|
# makefiles are read from during build but also where the SOPE makefiles are
|
||||||
|
# installed to in the install phase. We move them over after the installation.
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export DESTDIR="$out"
|
mkdir -p /build/Makefiles
|
||||||
|
ln -s ${gnustep.make}/share/GNUstep/Makefiles/* /build/Makefiles
|
||||||
|
cat <<EOF > /build/GNUstep.conf
|
||||||
|
GNUSTEP_MAKEFILES=/build/Makefiles
|
||||||
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = [ "--prefix=" "--disable-debug" "--enable-xml" "--with-ssl=ssl" ]
|
configureFlags = [ "--prefix=" "--disable-debug" "--enable-xml" "--with-ssl=ssl" ]
|
||||||
|
@ -33,10 +49,12 @@ gnustep.stdenv.mkDerivation rec {
|
||||||
++ lib.optional (mariadb != null) "--enable-mysql"
|
++ lib.optional (mariadb != null) "--enable-mysql"
|
||||||
++ lib.optional (postgresql != null) "--enable-postgresql";
|
++ lib.optional (postgresql != null) "--enable-postgresql";
|
||||||
|
|
||||||
# Yes, this is ugly.
|
env.GNUSTEP_CONFIG_FILE = "/build/GNUstep.conf";
|
||||||
preFixup = ''
|
|
||||||
cp -rlPa $out/nix/store/*/* $out
|
# Move over the makefiles (see comment over preConfigure)
|
||||||
rm -rf $out/nix/store
|
postInstall = ''
|
||||||
|
mkdir -p $out/share/GNUstep/Makefiles
|
||||||
|
find /build/Makefiles -mindepth 1 -maxdepth 1 -not -type l -exec cp -r '{}' $out/share/GNUstep/Makefiles \;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
|
@ -65,8 +65,6 @@ gnustep.stdenv.mkDerivation rec {
|
||||||
for bin in $out/bin/*; do
|
for bin in $out/bin/*; do
|
||||||
wrapProgram $bin --prefix LD_LIBRARY_PATH : $out/lib/sogo --prefix GNUSTEP_CONFIG_FILE : $out/share/GNUstep/GNUstep.conf
|
wrapProgram $bin --prefix LD_LIBRARY_PATH : $out/lib/sogo --prefix GNUSTEP_CONFIG_FILE : $out/share/GNUstep/GNUstep.conf
|
||||||
done
|
done
|
||||||
|
|
||||||
rmdir $out/nix
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests.sogo = nixosTests.sogo;
|
passthru.tests.sogo = nixosTests.sogo;
|
||||||
|
|
Loading…
Reference in a new issue