lol

librep: fix build on gcc-14 & modernize

+26 -5
+26 -5
pkgs/by-name/li/librep/package.nix
··· 1 1 { 2 2 lib, 3 3 stdenv, 4 - fetchurl, 4 + fetchFromGitHub, 5 + fetchpatch, 5 6 autoreconfHook, 6 7 gdbm, 7 8 gmp, ··· 9 10 pkg-config, 10 11 readline, 11 12 texinfo, 13 + versionCheckHook, 12 14 }: 13 15 14 16 stdenv.mkDerivation (finalAttrs: { 15 17 pname = "librep"; 16 18 version = "0.92.7"; 17 19 18 - src = fetchurl { 19 - url = "https://download.tuxfamily.org/librep/librep_${finalAttrs.version}.tar.xz"; 20 - hash = "sha256-SKGWeax8BTCollfeGP/knFdZpf9w/IRJKLDl0AOVrK4="; 20 + src = fetchFromGitHub { 21 + owner = "SawfishWM"; 22 + repo = "librep"; 23 + tag = "librep-${finalAttrs.version}"; 24 + hash = "sha256-0Ltysy+ilNhlXmvzSCMfF1n3x7F1idCRrhBFX/+n9uU="; 21 25 }; 22 26 27 + patches = [ 28 + # build: fix -Wimplicit-int, -Wimplicit-function-declaration (Clang 16) 29 + (fetchpatch { 30 + name = "fix-implicit-int"; 31 + url = "https://github.com/SawfishWM/librep/commit/48f557ab34d47a7a1fd9e8425542f720be40946e.patch"; 32 + hash = "sha256-MbFBNCgjEU1/QnjOe3uCWKVhpxo/E8c9q2TT3+CwPfY="; 33 + }) 34 + ]; 35 + 23 36 nativeBuildInputs = [ 24 37 autoreconfHook 25 38 pkg-config ··· 34 47 ]; 35 48 36 49 strictDeps = true; 50 + enableParallelBuilding = true; 37 51 38 52 # ensure libsystem/ctype functions don't get duplicated when using clang 39 53 configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "CFLAGS=-std=gnu89" ]; 40 54 41 55 setupHook = ./setup-hook.sh; 42 56 57 + nativeInstallCheckInputs = [ 58 + versionCheckHook 59 + ]; 60 + doInstallCheck = true; 61 + versionCheckProgramArg = [ "--version" ]; 62 + versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}"; 63 + 43 64 meta = { 44 65 homepage = "http://sawfish.tuxfamily.org/"; 45 66 description = "Fast, lightweight, and versatile Lisp environment"; ··· 51 72 license = lib.licenses.gpl2Plus; 52 73 maintainers = [ ]; 53 74 platforms = lib.platforms.unix; 75 + mainProgram = "rep"; 54 76 }; 55 77 }) 56 - # TODO: investigate fetchFromGithub