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/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 <libtcc.pc < @@ -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 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; { 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; }; } diff --git a/pkgs/development/tools/metals/default.nix b/pkgs/development/tools/metals/default.nix index 45ea829299a0..27e8ec08752a 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 ]; @@ -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; { 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"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fd0ae7da977d..cf194c97351d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -828,6 +828,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 { };