diff --git a/pkgs/by-name/cd/cdb/disable-chmod-dirs.patch b/pkgs/by-name/cd/cdb/disable-chmod-dirs.patch new file mode 100644 index 000000000000..64eefa873b57 --- /dev/null +++ b/pkgs/by-name/cd/cdb/disable-chmod-dirs.patch @@ -0,0 +1,22 @@ +diff --git a/instcopy.c b/instcopy.c +index 5e3b245..a1270ce 100644 +--- a/instcopy.c ++++ b/instcopy.c +@@ -31,8 +31,6 @@ void hier_h(const char *home,num mode) + if (mkdir(home,0700) == -1) + if (errno != EEXIST) + strerr_die4sys(111,FATAL,"unable to mkdir ",home,": "); +- if (chmod(home,mode) == -1) +- strerr_die4sys(111,FATAL,"unable to chmod ",home,": "); + } + + void hier_d(const char *home,const char *subdir,num mode) +@@ -42,8 +40,6 @@ void hier_d(const char *home,const char *subdir,num mode) + if (mkdir(subdir,0700) == -1) + if (errno != EEXIST) + strerr_die6sys(111,FATAL,"unable to mkdir ",home,"/",subdir,": "); +- if (chmod(subdir,mode) == -1) +- strerr_die6sys(111,FATAL,"unable to chmod ",home,"/",subdir,": "); + } + + static char inbuf_space[INBUF_SIZE]; diff --git a/pkgs/by-name/cd/cdb/package.nix b/pkgs/by-name/cd/cdb/package.nix new file mode 100644 index 000000000000..43795b8801cb --- /dev/null +++ b/pkgs/by-name/cd/cdb/package.nix @@ -0,0 +1,57 @@ +{ + stdenv, + lib, + fetchurl, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "cdb"; + version = "20251021"; + + src = fetchurl { + url = "https://cdb.cr.yp.to/cdb-${finalAttrs.version}.tar.gz"; + hash = "sha256-jlMdY5C818mky9Fv7TYybu546LDlwHg6gVimp5Q3490="; + }; + + outputs = [ + "out" + "doc" + "man" + ]; + + patches = [ + # disable chmod on output directories + ./disable-chmod-dirs.patch + ]; + + postPatch = '' + # Don't hardcode gcc + substituteInPlace conf-cc conf-ld --replace-fail 'gcc' '${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc' + ''; + + configurePhase = '' + runHook preConfigure + + # Set install prefix to output directory + echo "$out" > conf-home + + runHook postConfigure + ''; + + postInstall = '' + mkdir -p $man/share/man/man1 $man/share/man/man3 + cp doc/man/*.1 $man/share/man/man1/ + cp doc/man/*.3 $man/share/man/man3/ + + mkdir -p $doc/share/doc/cdb + cp doc/*.md $doc/share/doc/cdb/ + cp -r doc/html $doc/share/doc/cdb/ + ''; + + meta = { + homepage = "https://cdb.cr.yp.to/"; + license = lib.licenses.publicDomain; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/development/tools/database/cdb/default.nix b/pkgs/development/tools/database/cdb/default.nix deleted file mode 100644 index c92961ef09e5..000000000000 --- a/pkgs/development/tools/database/cdb/default.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - stdenv, - lib, - fetchurl, - fetchFromGitHub, -}: - -let - version = "0.75"; - sha256 = "1iajg55n47hqxcpdzmyq4g4aprx7bzxcp885i850h355k5vmf68r"; - # Please don’t forget to update the docs: - # clone https://github.com/Profpatsch/cdb-docs - # and create a pull request with the result of running - # ./update - # from the repository’s root folder. - docRepo = fetchFromGitHub { - owner = "Profpatsch"; - repo = "cdb-docs"; - rev = "359b6c55c9e170ebfc88f3f38face8ae2315eacb"; - sha256 = "1y0ivviy58i0pmavhvrpznc4yjigjknff298gnw9rkg5wxm0gbbq"; - }; - -in -stdenv.mkDerivation { - pname = "cdb"; - inherit version; - - src = fetchurl { - url = "https://cr.yp.to/cdb/cdb-${version}.tar.gz"; - inherit sha256; - }; - - outputs = [ - "bin" - "doc" - "out" - ]; - - env.NIX_CFLAGS_COMPILE = toString [ - "-Wno-error=implicit-int" - "-Wno-error=implicit-function-declaration" - ]; - - postPatch = '' - # A little patch, borrowed from Archlinux AUR, borrowed from Gentoo Portage - sed -e 's/^extern int errno;$/#include /' -i error.h - ''; - - postInstall = '' - # don't use make setup, but move the binaries ourselves - mkdir -p $bin/bin - install -m 755 -t $bin/bin/ cdbdump cdbget cdbmake cdbmake-12 cdbmake-sv cdbstats cdbtest - - # patch paths in scripts - function cdbmake-subst { - substituteInPlace $bin/bin/$1 \ - --replace /usr/local/bin/cdbmake $bin/bin/cdbmake - } - cdbmake-subst cdbmake-12 - cdbmake-subst cdbmake-sv - - # docs - mkdir -p $doc/share/cdb - cp -r "${docRepo}/docs" $doc/share/cdb/html - ''; - - meta = { - homepage = "https://cr.yp.to/cdb.html"; - license = lib.licenses.publicDomain; - maintainers = [ ]; - platforms = lib.platforms.unix; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 998020dfd661..e894c3509432 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3598,10 +3598,6 @@ with pkgs; egg2nix ; - cdb = callPackage ../development/tools/database/cdb { - stdenv = gccStdenv; - }; - libclang = llvmPackages.libclang; clang-manpages = llvmPackages.clang-manpages;