From 01bc1a863de31e98627a68da04eb9adb681b808b Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Wed, 13 Jul 2022 19:34:56 +0800 Subject: [PATCH 01/10] libbsd: fix build on darwin Add libbsd_symver_weak macro Detect and skip group_from_gid & user_from_uid when provided by os. Signed-off-by: Jiajie Chen --- .../development/libraries/libbsd/darwin.patch | 162 ++++++++++++------ 1 file changed, 112 insertions(+), 50 deletions(-) diff --git a/pkgs/development/libraries/libbsd/darwin.patch b/pkgs/development/libraries/libbsd/darwin.patch index f491867ac5aa..c52c64f35aee 100644 --- a/pkgs/development/libraries/libbsd/darwin.patch +++ b/pkgs/development/libraries/libbsd/darwin.patch @@ -1,8 +1,8 @@ -diff --git c/configure.ac w/configure.ac -index 09cb310..30c0e2a 100644 ---- c/configure.ac -+++ w/configure.ac -@@ -110,7 +110,7 @@ AS_CASE([$host_os], +diff --git a/configure.ac b/configure.ac +index 5b6d22b..98c449b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -145,7 +145,7 @@ AS_CASE([$host_os], AM_CONDITIONAL([OS_WINDOWS], [test "x$is_windows" = "xyes"]) # Checks for header files. @@ -11,20 +11,51 @@ index 09cb310..30c0e2a 100644 # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE -@@ -210,7 +210,8 @@ AC_LINK_IFELSE( +@@ -245,7 +245,9 @@ AC_LINK_IFELSE( AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \ getauxval getentropy getexecname getline \ - pstat_getproc sysconf]) + pstat_getproc sysconf \ -+ strlcpy strlcat strnstr strmode fpurge]) ++ strlcpy strlcat strnstr strmode fpurge \ ++ user_from_uid group_from_gid]) AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"]) - AC_SUBST([LIBBSD_LIBS]) -diff --git c/include/bsd/string.h w/include/bsd/string.h + AC_SUBST([MD5_LIBS]) +diff --git a/include/bsd/grp.h b/include/bsd/grp.h +index b2705e5..c9423a2 100644 +--- a/include/bsd/grp.h ++++ b/include/bsd/grp.h +@@ -44,8 +44,10 @@ + __BEGIN_DECLS + int + gid_from_group(const char *, gid_t *); ++#if !HAVE_GROUP_FROM_GID + const char * + group_from_gid(gid_t, int); ++#endif + __END_DECLS + + #endif +diff --git a/include/bsd/pwd.h b/include/bsd/pwd.h +index 798af4b..6ae5244 100644 +--- a/include/bsd/pwd.h ++++ b/include/bsd/pwd.h +@@ -44,8 +44,10 @@ + __BEGIN_DECLS + int + uid_from_user(const char *, uid_t *); ++#if !HAVE_USER_FROM_UID + const char * + user_from_uid(uid_t, int); ++#endif + __END_DECLS + + #endif +diff --git a/include/bsd/string.h b/include/bsd/string.h index f987fee..a1e17ed 100644 ---- c/include/bsd/string.h -+++ w/include/bsd/string.h +--- a/include/bsd/string.h ++++ b/include/bsd/string.h @@ -41,10 +41,21 @@ #include @@ -47,10 +78,10 @@ index f987fee..a1e17ed 100644 #if !defined(__GLIBC__) || \ (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE))) -diff --git c/src/fpurge.c w/src/fpurge.c -index 462535a..a8941db 100644 ---- c/src/fpurge.c -+++ w/src/fpurge.c +diff --git a/src/fpurge.c b/src/fpurge.c +index 350f364..ff7f01e 100644 +--- a/src/fpurge.c ++++ b/src/fpurge.c @@ -26,9 +26,10 @@ #include @@ -100,10 +131,10 @@ index 462535a..a8941db 100644 #else #error "Function fpurge() needs to be ported." #endif -diff --git c/src/funopen.c w/src/funopen.c +diff --git a/src/funopen.c b/src/funopen.c index 1e6f43a..3a3af6a 100644 ---- c/src/funopen.c -+++ w/src/funopen.c +--- a/src/funopen.c ++++ b/src/funopen.c @@ -143,6 +143,7 @@ funopen(const void *cookie, * they will not add the needed support to implement it. Just ignore this * interface there, as it has never been provided anyway. @@ -112,31 +143,32 @@ index 1e6f43a..3a3af6a 100644 #else #error "Function funopen() needs to be ported or disabled." #endif -diff --git c/src/local-link.h w/src/local-link.h -index 0d4351a..fc520af 100644 ---- c/src/local-link.h -+++ w/src/local-link.h -@@ -27,6 +27,11 @@ - #ifndef LIBBSD_LOCAL_LINK_H - #define LIBBSD_LOCAL_LINK_H +diff --git a/src/local-link.h b/src/local-link.h +index 6782d9a..fb76098 100644 +--- a/src/local-link.h ++++ b/src/local-link.h +@@ -29,6 +29,12 @@ + + #include +#ifdef __MACH__ +#define libbsd_link_warning(symbol, msg) +#define libbsd_symver_default(alias, symbol, version) +#define libbsd_symver_variant(alias, symbol, version) ++#define libbsd_symver_weak(alias, symbol, version) +#else #define libbsd_link_warning(symbol, msg) \ static const char libbsd_emit_link_warning_##symbol[] \ - __attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg; -@@ -45,3 +50,4 @@ + __attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg +@@ -68,3 +74,4 @@ #endif #endif +#endif -diff --git c/src/nlist.c w/src/nlist.c -index d22fa19..f41333f 100644 ---- c/src/nlist.c -+++ w/src/nlist.c +diff --git a/src/nlist.c b/src/nlist.c +index 1cb9d18..b476f1e 100644 +--- a/src/nlist.c ++++ b/src/nlist.c @@ -41,6 +41,7 @@ #include #include @@ -144,16 +176,46 @@ index d22fa19..f41333f 100644 +#if !HAVE_NLIST_H #include "local-elf.h" - #ifndef SIZE_T_MAX -@@ -282,3 +283,4 @@ nlist(const char *name, struct nlist *list) + /* Note: This function is used by libkvm0, so we need to export it. +@@ -277,3 +278,4 @@ nlist(const char *name, struct nlist *list) (void)close(fd); return (n); } +#endif -diff --git c/src/readpassphrase.c w/src/readpassphrase.c +diff --git a/src/pwcache.c b/src/pwcache.c +index d54daa0..74fde9f 100644 +--- a/src/pwcache.c ++++ b/src/pwcache.c +@@ -191,6 +191,7 @@ grptb_start(void) + return 0; + } + ++#if !HAVE_USER_FROM_UID + /* + * user_from_uid() + * caches the name (if any) for the uid. If noname clear, we always +@@ -251,7 +252,9 @@ user_from_uid(uid_t uid, int noname) + } + return ptr->name; + } ++#endif + ++#if !HAVE_USER_FROM_UID + /* + * group_from_gid() + * caches the name (if any) for the gid. If noname clear, we always +@@ -312,6 +315,7 @@ group_from_gid(gid_t gid, int noname) + } + return ptr->name; + } ++#endif + + /* + * uid_from_user() +diff --git a/src/readpassphrase.c b/src/readpassphrase.c index f9f6195..2bc5fb4 100644 ---- c/src/readpassphrase.c -+++ w/src/readpassphrase.c +--- a/src/readpassphrase.c ++++ b/src/readpassphrase.c @@ -36,6 +36,14 @@ #define TCSASOFT 0 #endif @@ -169,10 +231,10 @@ index f9f6195..2bc5fb4 100644 static volatile sig_atomic_t signo[_NSIG]; static void handler(int); -diff --git c/src/setproctitle.c w/src/setproctitle.c -index ff32aa3..51ed833 100644 ---- c/src/setproctitle.c -+++ w/src/setproctitle.c +diff --git a/src/setproctitle.c b/src/setproctitle.c +index d3e1087..0e5f64c 100644 +--- a/src/setproctitle.c ++++ b/src/setproctitle.c @@ -33,6 +33,10 @@ #include #include "local-link.h" @@ -184,7 +246,7 @@ index ff32aa3..51ed833 100644 static struct { /* Original value. */ const char *arg0; -@@ -287,7 +291,8 @@ libbsd_symver_default(setproctitle, setproctitle_impl, LIBBSD_0.5); +@@ -291,7 +295,8 @@ libbsd_symver_default(setproctitle, setproctitle_impl, LIBBSD_0.5); * in 0.5, make the implementation available in the old version as an alias * for code linking against that version, and change the default to use the * new version, so that new code depends on the implemented version. */ @@ -194,10 +256,10 @@ index ff32aa3..51ed833 100644 extern __typeof__(setproctitle_impl) setproctitle_stub __attribute__((__alias__("setproctitle_impl"))); -diff --git c/src/strlcat.c w/src/strlcat.c +diff --git a/src/strlcat.c b/src/strlcat.c index 14c53a1..5961c17 100644 ---- c/src/strlcat.c -+++ w/src/strlcat.c +--- a/src/strlcat.c ++++ b/src/strlcat.c @@ -26,6 +26,7 @@ * Returns strlen(src) + MIN(dsize, strlen(initial dst)). * If retval >= dsize, truncation occurred. @@ -211,10 +273,10 @@ index 14c53a1..5961c17 100644 return(dlen + (src - osrc)); /* count does not include NUL */ } +#endif -diff --git c/src/strlcpy.c w/src/strlcpy.c +diff --git a/src/strlcpy.c b/src/strlcpy.c index e9a7fe4..5137acb 100644 ---- c/src/strlcpy.c -+++ w/src/strlcpy.c +--- a/src/strlcpy.c ++++ b/src/strlcpy.c @@ -24,6 +24,7 @@ * chars will be copied. Always NUL terminates (unless dsize == 0). * Returns strlen(src); if retval >= dsize, truncation occurred. @@ -228,10 +290,10 @@ index e9a7fe4..5137acb 100644 return(src - osrc - 1); /* count does not include NUL */ } +#endif -diff --git c/src/strmode.c w/src/strmode.c +diff --git a/src/strmode.c b/src/strmode.c index e6afde5..da680c9 100644 ---- c/src/strmode.c -+++ w/src/strmode.c +--- a/src/strmode.c ++++ b/src/strmode.c @@ -32,6 +32,7 @@ #include #include From e84435878ca0555f927c00c54f83c0de179d0c2a Mon Sep 17 00:00:00 2001 From: Kevin Rauscher Date: Tue, 19 Jul 2022 13:55:33 +0200 Subject: [PATCH 02/10] metals: 0.11.6 -> 0.11.7 --- pkgs/development/tools/metals/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/metals/default.nix b/pkgs/development/tools/metals/default.nix index 45ea829299a0..4154eb4623ee 100644 --- a/pkgs/development/tools/metals/default.nix +++ b/pkgs/development/tools/metals/default.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "metals"; - version = "0.11.6"; + version = "0.11.7"; deps = stdenv.mkDerivation { name = "${pname}-deps-${version}"; @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { ''; outputHashMode = "recursive"; outputHashAlgo = "sha256"; - outputHash = "sha256-/tFc7xAuUtx2JgEMLhGaq2FXpt7KQNMi82ODr/gTfhM="; + outputHash = "sha256-Zc/0kod3JM58WpyxwXiyQdixBHOJV7UDGg1YZtHJ3hw="; }; nativeBuildInputs = [ makeWrapper setJavaClassPath ]; From f49a09b5a2effde9bc1cdbab8133935a9ab3b9ea Mon Sep 17 00:00:00 2001 From: Kevin Rauscher Date: Tue, 19 Jul 2022 21:51:19 +0200 Subject: [PATCH 03/10] metals: remove client specific wrappers --- pkgs/development/tools/metals/default.nix | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pkgs/development/tools/metals/default.nix b/pkgs/development/tools/metals/default.nix index 4154eb4623ee..27e8ec08752a 100644 --- a/pkgs/development/tools/metals/default.nix +++ b/pkgs/development/tools/metals/default.nix @@ -29,23 +29,8 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p $out/bin - # This variant is not targeted at any particular client, clients are - # expected to declare their supported features in initialization options. makeWrapper ${jre}/bin/java $out/bin/metals \ --add-flags "${extraJavaOpts} -cp $CLASSPATH scala.meta.metals.Main" - - # Further variants targeted at clients with featuresets pre-set. - makeWrapper ${jre}/bin/java $out/bin/metals-emacs \ - --add-flags "${extraJavaOpts} -Dmetals.client=emacs -cp $CLASSPATH scala.meta.metals.Main" - - makeWrapper ${jre}/bin/java $out/bin/metals-vim \ - --add-flags "${extraJavaOpts} -Dmetals.client=coc.nvim -cp $CLASSPATH scala.meta.metals.Main" - - makeWrapper ${jre}/bin/java $out/bin/metals-vim-lsc \ - --add-flags "${extraJavaOpts} -Dmetals.client=vim-lsc -cp $CLASSPATH scala.meta.metals.Main" - - makeWrapper ${jre}/bin/java $out/bin/metals-sublime \ - --add-flags "${extraJavaOpts} -Dmetals.client=sublime -cp $CLASSPATH scala.meta.metals.Main" ''; meta = with lib; { From 7249b8a2f3318bb03c50429f5907015e99901c0b Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 22 Jun 2022 15:22:51 +0300 Subject: [PATCH 04/10] makePkgconfigItem: init new function to generate pc files A function to generate pkg-config files for Nix packages that need to create them ad hoc, like blas and lapack. Inspiration taken from `makeDesktopItem`. --- .../make-pkgconfigitem/default.nix | 69 +++++++++++++++++++ .../setup-hooks/copy-pkgconfig-items.sh | 46 +++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 3 files changed, 119 insertions(+) create mode 100644 pkgs/build-support/make-pkgconfigitem/default.nix create mode 100644 pkgs/build-support/setup-hooks/copy-pkgconfig-items.sh diff --git a/pkgs/build-support/make-pkgconfigitem/default.nix b/pkgs/build-support/make-pkgconfigitem/default.nix new file mode 100644 index 000000000000..288ca3810eb8 --- /dev/null +++ b/pkgs/build-support/make-pkgconfigitem/default.nix @@ -0,0 +1,69 @@ +{ lib, writeTextFile, buildPackages }: + +# See https://people.freedesktop.org/~dbn/pkg-config-guide.html#concepts +{ name # The name of the pc file + # keywords + # provide a default description for convenience. it's not important but still required by pkg-config. +, description ? "A pkg-config file for ${name}" +, url ? "" +, version ? "" +, requires ? [ ] +, requiresPrivate ? [ ] +, conflicts ? [ ] +, cflags ? [ ] +, libs ? [ ] +, libsPrivate ? [ ] +, variables ? { } +}: + +let + # only 'out' has to be changed, otherwise it would be replaced by the out of the writeTextFile + placeholderToSubstVar = builtins.replaceStrings [ "${placeholder "out"}" ] [ "@out@" ]; + + replacePlaceholderAndListToString = x: + if builtins.isList x + then placeholderToSubstVar (builtins.concatStringsSep " " x) + else placeholderToSubstVar x; + + keywordsSection = + let + mustBeAList = attr: attrName: lib.throwIfNot (lib.isList attr) "'${attrName}' must be a list" attr; + in + { + "Name" = name; + "Description" = description; + "URL" = url; + "Version" = version; + "Requires" = mustBeAList requires "requires"; + "Requires.private" = mustBeAList requiresPrivate "requiresPrivate"; + "Conflicts" = mustBeAList conflicts "conflicts"; + "Cflags" = mustBeAList cflags "cflags"; + "Libs" = mustBeAList libs "libs"; + "Libs.private" = mustBeAList libsPrivate "libsPrivate"; + }; + + renderVariable = name: value: + lib.optionalString (value != "" && value != [ ]) "${name}=${replacePlaceholderAndListToString value}"; + renderKeyword = name: value: + lib.optionalString (value != "" && value != [ ]) "${name}: ${replacePlaceholderAndListToString value}"; + + renderSomething = renderFunc: attrs: + lib.pipe attrs [ + (lib.mapAttrsToList renderFunc) + (builtins.filter (v: v != "")) + (builtins.concatStringsSep "\n") + (section: ''${section} + '') + ]; + + variablesSectionRendered = renderSomething renderVariable variables; + keywordsSectionRendered = renderSomething renderKeyword keywordsSection; + + content = [ variablesSectionRendered keywordsSectionRendered ]; +in +writeTextFile { + name = "${name}.pc"; + destination = "/lib/pkgconfig/${name}.pc"; + text = builtins.concatStringsSep "\n" content; + checkPhase = ''${buildPackages.pkg-config}/bin/pkg-config --validate "$target"''; +} diff --git a/pkgs/build-support/setup-hooks/copy-pkgconfig-items.sh b/pkgs/build-support/setup-hooks/copy-pkgconfig-items.sh new file mode 100644 index 000000000000..8c04ec9b5f0e --- /dev/null +++ b/pkgs/build-support/setup-hooks/copy-pkgconfig-items.sh @@ -0,0 +1,46 @@ +# shellcheck shell=bash + +# Setup hook that installs specified pkgconfig items. +# +# Example usage in a derivation: +# +# { …, makePkgconfigItem, copyPkgconfigItems, … }: +# +# let pkgconfigItem = makePkgconfigItem { … }; in +# stdenv.mkDerivation { +# … +# nativeBuildInputs = [ copyPkgconfigItems ]; +# +# pkgconfigItems = [ pkgconfigItem ]; +# … +# } +# +# This hook will copy files which are either given by full path +# or all '*.pc' files placed inside the 'lib/pkgconfig' +# folder of each `pkgconfigItems` argument. + +postInstallHooks+=(copyPkgconfigItems) + +copyPkgconfigItems() { + if [ "${dontCopyPkgconfigItems-}" = 1 ]; then return; fi + + if [ -z "$pkgconfigItems" ]; then + return + fi + + pkgconfigdir="${!outputDev}/lib/pkgconfig" + for pkgconfigItem in $pkgconfigItems; do + if [[ -f "$pkgconfigItem" ]]; then + substituteAllInPlace "$pkgconfigItem" + echo "Copying '$pkgconfigItem' into '${pkgconfigdir}'" + install -D -m 444 -t "${pkgconfigdir}" "$pkgconfigItem" + substituteAllInPlace "${pkgconfigdir}"/* + else + for f in "$pkgconfigItem"/lib/pkgconfig/*.pc; do + echo "Copying '$f' into '${pkgconfigdir}'" + install -D -m 444 -t "${pkgconfigdir}" "$f" + substituteAllInPlace "${pkgconfigdir}"/* + done + fi + done +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e9102ff37f57..f1520606dd70 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -826,6 +826,10 @@ with pkgs; makeDesktopItem = callPackage ../build-support/make-desktopitem { }; + copyPkgconfigItems = makeSetupHook { } ../build-support/setup-hooks/copy-pkgconfig-items.sh; + + makePkgconfigItem = callPackage ../build-support/make-pkgconfigitem { }; + makeDarwinBundle = callPackage ../build-support/make-darwin-bundle { }; makeAutostartItem = callPackage ../build-support/make-startupitem { }; From 0b7a3b24d606b794785e5d8a7b81138a9815d216 Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 22 Jun 2022 19:24:31 +0300 Subject: [PATCH 05/10] stb: add pkgconfig file --- pkgs/development/libraries/stb/default.nix | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/stb/default.nix b/pkgs/development/libraries/stb/default.nix index 22a97d890e56..fee0cb42164e 100644 --- a/pkgs/development/libraries/stb/default.nix +++ b/pkgs/development/libraries/stb/default.nix @@ -1,6 +1,6 @@ -{ lib, stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub, copyPkgconfigItems, makePkgconfigItem }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "stb"; version = "unstable-2021-09-10"; @@ -11,11 +11,28 @@ stdenv.mkDerivation { sha256 = "0qq35cd747lll4s7bmnxb3pqvyp2hgcr9kyf758fax9lx76iwjhr"; }; + nativeBuildInputs = [ copyPkgconfigItems ]; + + pkgconfigItems = [ + (makePkgconfigItem rec { + name = "stb"; + version = "1"; + cflags = [ "-I${variables.includedir}/stb" ]; + variables = rec { + prefix = "${placeholder "out"}"; + includedir = "${prefix}/include"; + }; + inherit (meta) description; + }) + ]; + dontBuild = true; installPhase = '' + runHook preInstall mkdir -p $out/include/stb cp *.h $out/include/stb/ + runHook postInstall ''; meta = with lib; { From c6a9d069e938c3018d58ad2624cfd660e805841b Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 20 Jul 2022 06:22:14 +0300 Subject: [PATCH 06/10] tinycc: use makePkgconfigItem --- pkgs/development/compilers/tinycc/default.nix | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index ced8312dbf5a..693326620530 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -1,6 +1,8 @@ { lib , stdenv , fetchFromRepoOrCz +, copyPkgconfigItems +, makePkgconfigItem , perl , texinfo , which @@ -17,11 +19,32 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ + copyPkgconfigItems perl texinfo which ]; + pkgconfigItems = [ + (makePkgconfigItem rec { + name = "libtcc"; + inherit version; + cflags = [ "-I${variables.includedir}" ]; + libs = [ + "-L${variables.libdir}" + "-Wl,--rpath ${variables.libdir}" + "-ltcc" + "-ldl" + ]; + variables = rec { + prefix = "${placeholder "out"}"; + includedir = "${prefix}/include"; + libdir = "${prefix}/lib"; + }; + description = "Tiny C compiler backend"; + }) + ]; + postPatch = '' patchShebangs texi2pod.pl ''; @@ -43,17 +66,6 @@ stdenv.mkDerivation rec { configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)") ''; - postFixup = '' - cat >libtcc.pc < Date: Wed, 20 Jul 2022 20:53:19 +0200 Subject: [PATCH 07/10] python3.pkgs.pythonix: remove myself as maintainer --- pkgs/development/python-modules/pythonix/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pythonix/default.nix b/pkgs/development/python-modules/pythonix/default.nix index 9261ab2a8f23..9059e3b424ef 100644 --- a/pkgs/development/python-modules/pythonix/default.nix +++ b/pkgs/development/python-modules/pythonix/default.nix @@ -30,7 +30,7 @@ buildPythonPackage rec { description = '' Eval nix code from python. ''; - maintainers = [ maintainers.mic92 ]; + maintainers = [ ]; license = licenses.mit; }; } From 63e44027397c69d866095762cbe0ee5c06efc911 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Wed, 20 Jul 2022 20:29:58 +0000 Subject: [PATCH 08/10] gnu-cobol: refactor This is a major refactoring of the gnu-cobol package, which gives us: 1. Split outputs, allowing for small container images for COBOL applications. 2. Tests running (for Linux) 3. Parallel building 4. Documentation building 5. XML and JSON support Co-authored-by: Chad Crawford --- .../compilers/gnu-cobol/default.nix | 92 ++++++++++++++++--- 1 file changed, 79 insertions(+), 13 deletions(-) diff --git a/pkgs/development/compilers/gnu-cobol/default.nix b/pkgs/development/compilers/gnu-cobol/default.nix index 44c966fa974b..3f1268a9d65a 100644 --- a/pkgs/development/compilers/gnu-cobol/default.nix +++ b/pkgs/development/compilers/gnu-cobol/default.nix @@ -1,5 +1,22 @@ -{ lib, stdenv, fetchurl, gcc, makeWrapper -, db, gmp, ncurses }: +{ lib +, stdenv +, fetchurl +, autoconf269 +, automake +, libtool +# libs +, cjson +, db +, gmp +, libxml2 +, ncurses +# docs +, help2man +, texinfo +, texlive +# test +, writeText +}: stdenv.mkDerivation rec { pname = "gnu-cobol"; @@ -10,27 +27,76 @@ stdenv.mkDerivation rec { sha256 = "0x15ybfm63g7c9340fc6712h9v59spnbyaz4rf85pmnp3zbhaw2r"; }; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + autoconf269 + automake + libtool + help2man + texinfo + texlive.combined.scheme-basic + ]; - buildInputs = [ db gmp ncurses ]; + buildInputs = [ + cjson + db + gmp + libxml2 + ncurses + ]; - cflags = lib.concatMapStringsSep " " (p: "-L" + (lib.getLib p) + "/lib ") buildInputs; - ldflags = lib.concatMapStringsSep " " (p: "-I" + (lib.getDev p) + "/include ") buildInputs; + outputs = [ "bin" "dev" "lib" "out" ]; + # XXX: Without this, we get a cycle between bin and dev + propagatedBuildOutputs = []; - cobolCCFlags = "-I$out/include ${ldflags} -L$out/lib ${cflags}"; + # Skips a broken test + postPatch = '' + sed -i '/^AT_CHECK.*crud\.cob/i AT_SKIP_IF([true])' tests/testsuite.src/listings.at + ''; - postInstall = with lib; '' - wrapProgram "$out/bin/cobc" \ - --set COB_CC "${gcc}/bin/gcc" \ - --prefix COB_LDFLAGS " " "${cobolCCFlags}" \ - --prefix COB_CFLAGS " " "${cobolCCFlags}" + preConfigure = '' + autoconf + aclocal + automake + ''; + + enableParallelBuilding = true; + + installFlags = [ "install-pdf" "install-html" "localedir=$out/share/locale" ]; + + # Tests must run after install. + doCheck = false; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + # Run tests + make -j$NIX_BUILD_CORES check + + # Sanity check + message="Hello, COBOL!" + # XXX: Don't for a second think you can just get rid of these spaces, they + # are load bearing. + tee hello.cbl < Date: Wed, 20 Jul 2022 15:11:00 -0400 Subject: [PATCH 09/10] lemmy: 0.16.4 -> 0.16.6 --- pkgs/servers/web-apps/lemmy/package.json | 4 ++-- pkgs/servers/web-apps/lemmy/pin.json | 10 +++++----- pkgs/servers/web-apps/lemmy/server.nix | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/web-apps/lemmy/package.json b/pkgs/servers/web-apps/lemmy/package.json index 934cccd205f7..82b496f1bbed 100644 --- a/pkgs/servers/web-apps/lemmy/package.json +++ b/pkgs/servers/web-apps/lemmy/package.json @@ -1,7 +1,7 @@ { "name": "lemmy-ui", "description": "An isomorphic UI for lemmy", - "version": "0.16.4", + "version": "0.16.6", "author": "Dessalines ", "license": "AGPL-3.0", "scripts": { @@ -34,7 +34,7 @@ "inferno-server": "^7.4.11", "isomorphic-cookie": "^1.2.4", "jwt-decode": "^3.1.2", - "markdown-it": "^13.0.0", + "markdown-it": "^13.0.1", "markdown-it-container": "^3.0.0", "markdown-it-footnote": "^3.0.3", "markdown-it-html5-embed": "^1.0.0", diff --git a/pkgs/servers/web-apps/lemmy/pin.json b/pkgs/servers/web-apps/lemmy/pin.json index c22c821f5db3..dbd90ace9fbc 100644 --- a/pkgs/servers/web-apps/lemmy/pin.json +++ b/pkgs/servers/web-apps/lemmy/pin.json @@ -1,7 +1,7 @@ { - "version": "0.16.4", - "serverSha256": "sha256-xbxavlmRm7QTbrAjw6IMgQq8rEgyEHdcj11EhsOY+j0=", - "serverCargoSha256": "sha256-vDIaLpw0C6fnv0quH20qRN0I38Br338+MS9YzVfNizU=", - "uiSha256": "sha256-GZH/fSYLbxwigrr5LwAzxH4ElDVjTs8Tqqq+xYDFNCU", - "uiYarnDepsSha256": "sha256-BQs9UXUT/CcxJ7CdLksYGvGPGAaW7FLUAShLsbPC0jw=" + "version": "0.16.6", + "serverSha256": "sha256-nDmwn3moDFJtYNx/FY3uSpxCwE4Ni4udqF3MX3MNyYM=", + "serverCargoSha256": "sha256-f86UE7aVciHaTsK/jzABHEXBh2Pn6ErRBb52lW/f+1E=", + "uiSha256": "sha256-ZfD9QaycvjlFlbZNcMEf2bcrszYn8TWuPDYEhW+gITE=", + "uiYarnDepsSha256": "sha256-2NiDuqAyZeNn3c3XDeP2m5hHej4w4/gcabxfHgC8PV4=" } diff --git a/pkgs/servers/web-apps/lemmy/server.nix b/pkgs/servers/web-apps/lemmy/server.nix index 52dddc8183c0..65425eb96a16 100644 --- a/pkgs/servers/web-apps/lemmy/server.nix +++ b/pkgs/servers/web-apps/lemmy/server.nix @@ -47,7 +47,7 @@ rustPlatform.buildRustPackage rec { description = "🐀 Building a federated alternative to reddit in rust"; homepage = "https://join-lemmy.org/"; license = licenses.agpl3Only; - maintainers = with maintainers; [ happysalada ]; + maintainers = with maintainers; [ happysalada billewanick ]; mainProgram = "lemmy_server"; }; } From af7d2aaa0d7fae44cdef463538833d536e3def1f Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 21 Jul 2022 12:09:14 +1000 Subject: [PATCH 10/10] ffmpeg: add platforms --- pkgs/development/libraries/ffmpeg/generic.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 682b1aecf1e4..855586649b74 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -239,6 +239,7 @@ stdenv.mkDerivation rec { ''; license = licenses.gpl3; maintainers = with maintainers; [ ]; + platforms = platforms.all; inherit branch knownVulnerabilities; }; }