nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 cmake,
3 fetchFromGitHub,
4 lib,
5 lynx,
6 makeBinaryWrapper,
7 ncurses,
8 pcre,
9 perl,
10 perlPackages,
11 stdenv,
12}:
13let
14 shlomif-cmake-modules = fetchFromGitHub {
15 owner = "shlomif";
16 repo = "shlomif-cmake-modules";
17 rev = "2fa3e9be1a1df74ad0e10f0264bfa60e1e3a755c";
18 hash = "sha256-MNGpegbZRwfD8A3VHVNYrDULauLST3Nt18/3Ht6mpZw=";
19 };
20 perlDeps = with perlPackages; [
21 BitVector
22 CarpAlways
23 ClassXSAccessor
24 FileWhich
25 GD
26 ImageSize
27 ListMoreUtils
28 PathTiny
29 TermReadKey
30 ];
31in
32stdenv.mkDerivation (finalAttrs: {
33 pname = "wml";
34 version = "2.32.0";
35
36 src = fetchFromGitHub {
37 owner = "thewml";
38 repo = "website-meta-language";
39 tag = "releases/wml-${finalAttrs.version}";
40 hash = "sha256-9ZiMGm0W2qS/7nL8NsmGBsuB5sNJvWuJaxE7CTdWo6s=";
41 };
42
43 sourceRoot = "${finalAttrs.src.name}/src";
44
45 # https://github.com/thewml/website-meta-language/commit/727806494dcb9d334ffb324aedbf6076e4796299
46 postPatch = ''
47 substituteInPlace CMakeLists.txt \
48 --replace-fail 'CMAKE_MINIMUM_REQUIRED(VERSION 3.0)' 'CMAKE_MINIMUM_REQUIRED(VERSION 3.15)'
49 '';
50
51 nativeBuildInputs = [
52 cmake
53 lynx
54 makeBinaryWrapper
55 ];
56
57 buildInputs = perlDeps ++ [
58 ncurses
59 pcre
60 perl
61 ];
62
63 preConfigure = ''
64 ln -s ${shlomif-cmake-modules}/shlomif-cmake-modules/Shlomif_Common.cmake cmake/
65 '';
66
67 preFixup = ''
68 rm $out/bin/wmu
69
70 for f in $(find $out/bin/ -type f -executable); do
71 wrapProgram "$f" \
72 --set PERL5LIB ${perlPackages.makePerlPath perlDeps}
73 done
74 '';
75
76 meta = {
77 description = "Offline HTML preprocessor";
78 homepage = "https://www.shlomifish.org/open-source/projects/website-meta-language/";
79 downloadPage = "https://github.com/thewml/website-meta-language/releases";
80 changelog = "https://github.com/thewml/website-meta-language/blob/${finalAttrs.src.tag}/src/ChangeLog";
81 license = lib.licenses.gpl2;
82 maintainers = with lib.maintainers; [ prince213 ];
83 mainProgram = "wml";
84 platforms = lib.platforms.linux;
85 };
86})