From 95e764a9d393307fc97db44e5d8b161105419727 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 5 Oct 2022 15:23:50 +0800 Subject: [PATCH] xs: init at 2022-10-05 --- pkgs/default.nix | 1 + pkgs/xs/default.nix | 53 +++++++++++++++++++++++++++++ pkgs/xs/update-build.patch | 69 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 pkgs/xs/default.nix create mode 100644 pkgs/xs/update-build.patch diff --git a/pkgs/default.nix b/pkgs/default.nix index 72b8376c..9a5c670a 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -80,6 +80,7 @@ let watc = callPackage ./watc { }; wayback = callPackage ./wayback.nix { }; wzmach = callPackage ./wzmach { }; + xs = callPackage ./xs { }; }; in lib.fix' (lib.extends overrides packages) diff --git a/pkgs/xs/default.nix b/pkgs/xs/default.nix new file mode 100644 index 00000000..cc46eee3 --- /dev/null +++ b/pkgs/xs/default.nix @@ -0,0 +1,53 @@ +{ stdenv +, lib +, fetchFromGitHub +, boost +, boehmgc +, bison +, meson +, ninja +, pkg-config +, libffi +, readline +, git +}: + +stdenv.mkDerivation rec { + pname = "xs"; + version = "unstable-2022-10-05"; + + src = fetchFromGitHub { + owner = "TieDyedDevil"; + repo = "XS"; + rev = "789540c5f208b8e8f07fc81c3bec3d0ee47c6dea"; + sha256 = "sha256-Yx6zWLZlnlckZyTljgTVCjCPtNfUbM+o4RfuOPpn8ZQ="; + }; + + nativeBuildInputs = [ + meson + ninja + pkg-config + ]; + + buildInputs = [ + boost + bison + boehmgc + libffi + readline + git + ]; + + patches = [ ./update-build.patch ]; + postPatch = '' + patchShebangs ./generators/*.sh + ''; + + meta = with lib; { + homepage = "https://github.com/TieDyedDevil/XS"; + description = "Extensible shell with functional semantics and conventional syntax"; + + # See doc/ANCENSTORS and doc/COPYING files for more details. + license = licenses.publicDomain; + }; +} diff --git a/pkgs/xs/update-build.patch b/pkgs/xs/update-build.patch new file mode 100644 index 00000000..24c39aac --- /dev/null +++ b/pkgs/xs/update-build.patch @@ -0,0 +1,69 @@ +diff --git a/meson.build b/meson.build +index f20a8a2..1c09882 100644 +--- a/meson.build ++++ b/meson.build +@@ -16,31 +16,26 @@ project('xs', ['cpp']) + if not readline_lib.found() + readline_lib = compiler.find_library('readline') + endif +- custom_target('.stamp', +- build_always_stale: true, +- build_by_default: true, +- output: '.stamp', +- command: ['touch', '@OUTPUT@']) + custom_target('buildinfo.hxx', + build_always_stale: true, + build_by_default: true, + output: 'buildinfo.hxx', +- command: ['../generators/buildinfo.sh']) ++ command: ['./generators/buildinfo.sh']) + custom_target('git_date.hxx', + build_always_stale: true, + build_by_default: true, + output: 'git_date.hxx', +- command: ['../generators/git_date.sh']) ++ command: ['./generators/git_date.sh']) + custom_target('git_hash.hxx', + build_always_stale: true, + build_by_default: true, + output: 'git_hash.hxx', +- command: ['../generators/git_hash.sh']) ++ command: ['./generators/git_hash.sh']) + custom_target('git_url.hxx', + build_always_stale: true, + build_by_default: true, + output: 'git_url.hxx', +- command: ['../generators/git_url.sh']) ++ command: ['./generators/git_url.sh']) + parse_cxx = custom_target('parse.cxx', + depend_files: 'src/parse.yxx', + input: ['src/parse.yxx'], +@@ -48,7 +43,7 @@ project('xs', ['cpp']) + command: ['bison', '-d', '@INPUT@']) + sigmsgs_cxx = custom_target('sigmsgs.cxx', + output: 'sigmsgs.cxx', +- command: ['../generators/mksignal.sh', '@OUTPUT@']) ++ command: ['./generators/mksignal.sh', '@OUTPUT@']) + common_sources = ['src/access.cxx', 'src/closure.cxx', 'src/conv.cxx', + 'src/eval.cxx', 'src/fd.cxx', 'src/glob.cxx', 'src/glom.cxx', + 'src/heredoc.cxx', 'src/input.cxx', 'src/list.cxx', +@@ -68,7 +63,7 @@ project('xs', ['cpp']) + input: 'src/initial.xs', + output: 'initial.cxx', + depends: xsdump, +- command: ['../generators/initial.sh', '@INPUT@', '@OUTPUT@']) ++ command: ['./generators/initial.sh', '@INPUT@', '@OUTPUT@']) + xs = executable('xs', [initial_cxx, common_sources], + cpp_args: compile_flags, + link_args: link_flags, +@@ -81,10 +76,3 @@ project('xs', ['cpp']) + 'doc/XS-FOR-LISPERS.md', 'xs.lang'], + install_dir: 'share/doc/xs') + +-run_target('check', +- command: ['./build/xs', '-c', './tests/xs_tests.xs'], +- depends: xs) +- +-run_target('fuzz', +- command: ['./build/xs', '-c', './tests/fuzz.xs'], +- depends: xs)