From 83b16dfd2ac52f5d2a21cb316813744c1071d526 Mon Sep 17 00:00:00 2001 From: Fea Date: Tue, 12 Mar 2024 03:02:23 +0100 Subject: [PATCH 1/3] maintainers: add feathecutie --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 0dc30125384b9..a6b2b3213c09f 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6447,6 +6447,11 @@ githubId = 541748; name = "Felipe Espinoza"; }; + feathecutie = { + name = "feathecutie"; + github = "feathecutie"; + githubId = 53912746; + }; fedx-sudo = { email = "fedx-sudo@pm.me"; github = "FedX-sudo"; From a38953fa13fc466824a4256e625dcaa662a77285 Mon Sep 17 00:00:00 2001 From: Fea Date: Sat, 6 Jul 2024 19:48:08 +0200 Subject: [PATCH 2/3] inko: init at 0.15.0 --- pkgs/by-name/in/inko/package.nix | 68 ++++++++++++++++++++++++++++++++ pkgs/by-name/in/inko/test.nix | 39 ++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 pkgs/by-name/in/inko/package.nix create mode 100644 pkgs/by-name/in/inko/test.nix diff --git a/pkgs/by-name/in/inko/package.nix b/pkgs/by-name/in/inko/package.nix new file mode 100644 index 0000000000000..70abc78b0fe36 --- /dev/null +++ b/pkgs/by-name/in/inko/package.nix @@ -0,0 +1,68 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, llvm_16 +, libffi +, libz +, libxml2 +, ncurses +, stdenv +, makeWrapper +, callPackage +}: + +rustPlatform.buildRustPackage rec { + pname = "inko"; + version = "0.15.0"; + + src = fetchFromGitHub { + owner = "inko-lang"; + repo = "inko"; + rev = "v${version}"; + hash = "sha256-Iojv8pTyILYpLFnoTlgUGmlfWWH0DgsGBRxzd3oRNwA="; + }; + + cargoHash = "sha256-PaZD7wwcami6EWvOHLislNkwQhCZItN9XZkPSExwo0U="; + + buildInputs = [ + libffi + libz + libxml2 + ncurses + stdenv.cc.cc.lib + ]; + + nativeBuildInputs = [ + llvm_16 + makeWrapper + ]; + + env = { + INKO_STD = "${placeholder "out"}/lib"; + INKO_RT = "${placeholder "out"}/lib/runtime"; + }; + + postFixup = '' + wrapProgram $out/bin/inko \ + --prefix PATH : ${lib.makeBinPath [ stdenv.cc ]} + ''; + + postInstall = '' + mkdir -p $out/lib/runtime + mv $out/lib/*.a $out/lib/runtime/ + cp -r std/src/* $out/lib/ + ''; + + passthru.tests = { + simple = callPackage ./test.nix { }; + }; + + meta = { + description = "Language for building concurrent software with confidence"; + homepage = "https://inko-lang.org/"; + license = lib.licenses.mpl20; + maintainers = [ lib.maintainers.feathecutie ]; + platforms = lib.platforms.unix; + mainProgram = "inko"; + }; +} diff --git a/pkgs/by-name/in/inko/test.nix b/pkgs/by-name/in/inko/test.nix new file mode 100644 index 0000000000000..8d63dd07ccac6 --- /dev/null +++ b/pkgs/by-name/in/inko/test.nix @@ -0,0 +1,39 @@ +{ inko +, writeText +, runCommand +, ... +}: + +let + source = writeText "hello.inko" /* inko */ '' + import std.process (sleep) + import std.stdio (STDOUT) + import std.time (Duration) + + class async Printer { + fn async print(message: String, channel: Channel[Nil]) { + let _ = STDOUT.new.print(message) + + channel.send(nil) + } + } + + class async Main { + fn async main { + let channel = Channel.new(size: 2) + + Printer().print('Hello', channel) + Printer().print('world', channel) + + channel.receive + channel.receive + } + } + ''; +in + +runCommand "inko-test" { } '' + ${inko}/bin/inko run ${source} > $out + cat $out | grep -q Hello + cat $out | grep -q world +'' From bd3215c582ff2632eab834302e5dcac210564055 Mon Sep 17 00:00:00 2001 From: Fea Date: Sat, 6 Jul 2024 19:48:18 +0200 Subject: [PATCH 3/3] ivm: init at 0.5.0 --- pkgs/by-name/iv/ivm/package.nix | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 pkgs/by-name/iv/ivm/package.nix diff --git a/pkgs/by-name/iv/ivm/package.nix b/pkgs/by-name/iv/ivm/package.nix new file mode 100644 index 0000000000000..705bbf14a041c --- /dev/null +++ b/pkgs/by-name/iv/ivm/package.nix @@ -0,0 +1,54 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, makeWrapper +, cargo +, llvm_16 +, stdenv +, libffi +, libz +, libxml2 +, ncurses +}: + +rustPlatform.buildRustPackage rec { + pname = "ivm"; + version = "0.5.0"; + + src = fetchFromGitHub { + owner = "inko-lang"; + repo = "ivm"; + rev = "v${version}"; + hash = "sha256-z0oo1JUZbX3iT8N9+14NcqUzalpARImcbtUiQYS4djA="; + }; + + cargoHash = "sha256-EP3fS4lAGOaXJXAM22ZCn4+9Ah8TM1+wvNerKCKByo0="; + + buildInputs = [ + stdenv.cc.cc.lib + ]; + + nativeBuildInputs = [ + makeWrapper + ]; + + postFixup = '' + wrapProgram $out/bin/ivm \ + --prefix PATH : ${lib.makeBinPath [ cargo llvm_16.dev stdenv.cc ]} \ + --prefix LIBRARY_PATH : ${lib.makeLibraryPath [ + libffi + libz + libxml2 + ncurses + ]} + ''; + + meta = { + description = "Cross-platform Inko version manager"; + homepage = "https://github.com/inko-lang/ivm"; + license = lib.licenses.mpl20; + maintainers = [ lib.maintainers.feathecutie ]; + platforms = lib.platforms.unix; + mainProgram = "ivm"; + }; +}