at 23.11-beta 51 lines 1.5 kB view raw
1{ stdenv 2, fetchFromGitHub 3, cmake 4, lib 5, pkg-config 6, check 7}: 8stdenv.mkDerivation rec { 9 pname = "libcork"; 10 version = "1.0.0--rc3"; 11 12 src = fetchFromGitHub { 13 owner = "dcreager"; 14 repo = pname; 15 rev = version; 16 sha256 = "152gqnmr6wfmflf5l6447am4clmg3p69pvy3iw7yhaawjqa797sk"; 17 }; 18 19 postPatch = '' 20 # N.B. We need to create this file, otherwise it tries to use git to 21 # determine the package version, which we do not want. 22 echo "${version}" > .version-stamp 23 echo "${version}" > .commit-stamp 24 25 # N.B. We disable tests by force, since their build is broken. 26 sed -i '/add_subdirectory(tests)/d' ./CMakeLists.txt 27 28 # https://github.com/dcreager/libcork/issues/173 29 substituteInPlace cmake/FindCTargets.cmake \ 30 --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ 31 --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \ 32 --replace '\$'{datarootdir}/'$'{base_docdir} '$'{CMAKE_INSTALL_FULL_DOCDIR} 33 ''; 34 35 nativeBuildInputs = [ cmake pkg-config ]; 36 buildInputs = [ check ]; 37 38 doCheck = false; 39 40 postInstall = '' 41 ln -s $out/lib/libcork.so $out/lib/libcork.so.1 42 ''; 43 44 meta = with lib; { 45 homepage = "https://github.com/dcreager/libcork"; 46 description = "A simple, easily embeddable cross-platform C library"; 47 license = licenses.bsd3; 48 platforms = platforms.unix; 49 maintainers = with maintainers; [ lovesegfault ]; 50 }; 51}