|
1 | 1 | { |
| 2 | + cmake, |
| 3 | + fetchFromGitHub, |
2 | 4 | lib, |
3 | | - fetchurl, |
4 | | - perlPackages, |
5 | | - ncurses, |
6 | 5 | lynx, |
7 | | - makeWrapper, |
| 6 | + makeBinaryWrapper, |
| 7 | + ncurses, |
| 8 | + pcre, |
| 9 | + perl, |
| 10 | + perlPackages, |
| 11 | + stdenv, |
8 | 12 | }: |
9 | | - |
10 | | -perlPackages.buildPerlPackage { |
| 13 | +let |
| 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 | + ]; |
| 31 | +in |
| 32 | +stdenv.mkDerivation (finalAttrs: { |
11 | 33 | pname = "wml"; |
12 | | - version = "2.0.11"; |
| 34 | + version = "2.32.0"; |
13 | 35 |
|
14 | | - src = fetchurl { |
15 | | - url = "http://thewml.org/distrib/wml-2.0.11.tar.gz"; |
16 | | - sha256 = "0jjxpq91x7y2mgixz7ghqp01m24qa37wl3zz515rrzv7x8cyy4cf"; |
| 36 | + src = fetchFromGitHub { |
| 37 | + owner = "thewml"; |
| 38 | + repo = "website-meta-language"; |
| 39 | + tag = "releases/wml-${finalAttrs.version}"; |
| 40 | + hash = "sha256-9ZiMGm0W2qS/7nL8NsmGBsuB5sNJvWuJaxE7CTdWo6s="; |
17 | 41 | }; |
18 | 42 |
|
19 | | - setOutputFlags = false; |
| 43 | + sourceRoot = "${finalAttrs.src.name}/src"; |
20 | 44 |
|
21 | | - # Getting lots of Non-ASCII character errors from pod2man. |
22 | | - # Inserting =encoding utf8 before the first =head occurrence. |
23 | | - # Wasn't able to fix mp4h. |
24 | | - preConfigure = '' |
25 | | - touch Makefile.PL |
26 | | - for i in wml_backend/p6_asubst/asubst.src wml_aux/freetable/freetable.src wml_docs/*.pod wml_include/des/*.src wml_include/fmt/*.src; do |
27 | | - sed -i '0,/^=head/{s/^=head/=encoding utf8\n=head/}' $i |
28 | | - done |
29 | | - sed -i 's/ doc / /g' wml_backend/p2_mp4h/Makefile.in |
30 | | - sed -i '/p2_mp4h\/doc/d' Makefile.in |
| 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)' |
31 | 49 | ''; |
32 | 50 |
|
33 | | - nativeBuildInputs = [ makeWrapper ]; |
34 | | - buildInputs = with perlPackages; [ |
35 | | - perl |
36 | | - TermReadKey |
37 | | - GD |
38 | | - BitVector |
39 | | - ncurses |
| 51 | + nativeBuildInputs = [ |
| 52 | + cmake |
40 | 53 | lynx |
41 | | - ImageSize |
| 54 | + makeBinaryWrapper |
42 | 55 | ]; |
43 | 56 |
|
44 | | - patches = [ |
45 | | - ./redhat-with-thr.patch |
46 | | - ./dynaloader.patch |
47 | | - ./no_bitvector.patch |
| 57 | + buildInputs = perlDeps ++ [ |
| 58 | + ncurses |
| 59 | + pcre |
| 60 | + perl |
48 | 61 | ]; |
49 | 62 |
|
50 | | - # Workaround build failure on -fno-common toolchains: |
51 | | - # ld: iselect_browse.o:(.bss+0x2020): multiple definition of `Line'; iselect_main.o:(.bss+0x100000): first defined here |
52 | | - env.NIX_CFLAGS_COMPILE = "-fcommon"; |
53 | | - |
54 | | - hardeningDisable = [ "format" ]; |
55 | | - |
56 | | - postPatch = '' |
57 | | - substituteInPlace wml_frontend/wml.src \ |
58 | | - --replace "File::PathConvert::realpath" "Cwd::realpath" \ |
59 | | - --replace "File::PathConvert::abs2rel" "File::Spec->abs2rel" \ |
60 | | - --replace "File::PathConvert" "File::Spec" |
61 | | -
|
62 | | - for i in wml_include/des/imgbg.src wml_include/des/imgdot.src; do |
63 | | - substituteInPlace $i \ |
64 | | - --replace "WML::GD" "GD" |
65 | | - done |
66 | | -
|
67 | | - rm wml_test/t/11-wmk.t |
| 63 | + preConfigure = '' |
| 64 | + ln -s ${shlomif-cmake-modules}/shlomif-cmake-modules/Shlomif_Common.cmake cmake/ |
68 | 65 | ''; |
69 | 66 |
|
70 | 67 | preFixup = '' |
71 | | - wrapProgram $out/bin/wml \ |
72 | | - --set PERL5LIB ${ |
73 | | - with perlPackages; |
74 | | - makePerlPath [ |
75 | | - BitVector |
76 | | - TermReadKey |
77 | | - ImageSize |
78 | | - ] |
79 | | - } |
80 | | - ''; |
81 | | - |
82 | | - enableParallelBuilding = false; |
| 68 | + rm $out/bin/wmu |
83 | 69 |
|
84 | | - installTargets = [ "install" ]; |
| 70 | + for f in $(find $out/bin/ -type f -executable); do |
| 71 | + wrapProgram "$f" \ |
| 72 | + --set PERL5LIB ${perlPackages.makePerlPath perlDeps} |
| 73 | + done |
| 74 | + ''; |
85 | 75 |
|
86 | | - meta = with lib; { |
| 76 | + meta = { |
| 77 | + description = "Offline HTML preprocessor"; |
87 | 78 | homepage = "https://www.shlomifish.org/open-source/projects/website-meta-language/"; |
88 | | - description = "Off-line HTML generation toolkit for Unix"; |
89 | | - license = licenses.gpl2; |
90 | | - platforms = platforms.linux; |
| 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; |
91 | 85 | }; |
92 | | -} |
| 86 | +}) |
0 commit comments