Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luaPackages.middleclass: init at 4.1.1-0 #258547

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

tmillr
Copy link
Contributor

@tmillr tmillr commented Oct 2, 2023

This is my first pr to nixpkgs! Bare with me

Description of changes

Add Lua package https://luarocks.org/modules/kikito/middleclass

Some things to note

  • This is a basic, "pure lua", lib with no deps that appears to have been around awhile (and seems fairly popular).
  • This lua module consists of just a single file named middleclass.lua which is located in the root of the repo. Hopefully this doesn't cause issues when used with neovim?
  • I didn't implement tests/testing (checks?), not sure if this is necessary? I believe the repo does have tests and uses busted.
  • Still need to run update script to generate the nix expressions? But it keeps failing on me with a different error each time. (edit: nix expression/drv was added manually, see below)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Oct 2, 2023
@alyssais
Copy link
Member

alyssais commented Oct 2, 2023

@ofborg eval

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Oct 2, 2023
@teto
Copy link
Member

teto commented Oct 2, 2023

The updater is kinda tricky at the moment as you have noticed. You can generate the nix code by running luarocks-nix https://github.com/nix-community/luarocks-nix luarocks nix middleclass. It seems to fail though. I have a bunch of fixes in different related areas and I was planning to run an update of the lua package set this week so if you dont mind I can do it in your stead this week ?

@tmillr
Copy link
Contributor Author

tmillr commented Oct 3, 2023

You can generate the nix code by running luarocks-nix https://github.com/nix-community/luarocks-nix luarocks nix middleclass. It seems to fail though.

I can actually get it to generate with that cmd (via nix shell nixpkgs#luarocks-nix -c luarocks nix middleclass):

{ luaOlder, buildLuarocksPackage, fetchurl, lua }:
buildLuarocksPackage {
  pname = "middleclass";
  version = "4.1.1-0";
  knownRockspec = (fetchurl {
    url    = "mirror://luarocks/middleclass-4.1.1-0.rockspec";
    sha256 = "10xzs48lr1dy7cx99581r956gl16px0a9gbdlfar41n19r96mhb1";
  }).outPath;
  src = fetchurl {
    url    = "https://github.com/kikito/middleclass/archive/v4.1.1.tar.gz";
    sha256 = "11ahv0b9wgqfnabv57rb7ilsvn2vcvxb1czq6faqrsqylvr5l7nh";
  };

  disabled = (luaOlder "5.1");
  propagatedBuildInputs = [ lua ];

  meta = {
    homepage = "https://github.com/kikito/middleclass";
    description = "A simple OOP library for Lua";
    license.fullName = "MIT";
  };
}

Maybe it's working for me because my local nix installation is on unstable (instead of master)?

Although it seems to have a slightly different structure compared to what the mass-updater outputs? For example, here's the previous commit affecting the Lua pkg list/csv: 895d66d


if you dont mind I can do it in your stead this week ?

That's totally fine by me, whatever works.

I'll include what I've got for now. It appears to build just fine and can be required in the lua repl.

This lua module consists of just a single file named middleclass.lua which is located in the root of the repo. Hopefully this doesn't cause issues when used with neovim?

@tmillr tmillr force-pushed the lua/pkgs/middleclass branch from df91dc0 to ec5b607 Compare October 3, 2023 10:52
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Oct 3, 2023
@teto teto merged commit c02ab0c into NixOS:master Oct 3, 2023
19 checks passed
@teto
Copy link
Member

teto commented Oct 3, 2023

great ty. Format will get updated with #258819

@tmillr tmillr deleted the lua/pkgs/middleclass branch October 3, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: lua 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants