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

faustlive: init at 2017-12-05 #45493

Merged
merged 1 commit into from
Aug 28, 2018
Merged

Conversation

ThysBallard
Copy link
Contributor

@ThysBallard ThysBallard commented Aug 22, 2018

Motivation for this change

Added FaustLive package for fast prototyping with FAUST programming language

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@AndersonTorres
Copy link
Member

Well, I think we need some hints of style here! Are you ready? :)

@ThysBallard
Copy link
Contributor Author

@AndersonTorres I mean yeah, go for it.

stdenv.mkDerivation rec {
name = "faustlive-${version}";
version = "2017-12-05";
src = fetchgit {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I will suggest to use fetchFromGitHub. It is a less general function than fetchgit. It is always a better idea to use specialized fetchers, it reduces the "mental load".

You can look at this code as an example (yes, it's mine!):

src = fetchFromGitHub {
owner = "JWasm";
repo = "JWasm";
rev = "26f97c8b5c9d9341ec45538701116fa3649b7766";
sha256 = "0m972pc8vk8s9yv1pi85fsjgm6hj24gab7nalw2q04l0359nqi7w";
};

{ stdenv
, fetchgit
, llvm
, gnumake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait. I am a little confused.

Isn't gnumake and gnused part of stdenv? If you called stdenv, automatically GNU Make is present!

Did you find some difficulty? The expression works without that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, that was a leftover from an earlier version of the expression.

, gnused
, coreutils
, which
}:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. So much lines.

Try to organize them, putting various parameters in a same line (always respecting the magic 80-characters limit).

Also, try to organize them by, what I would say?, logic. Libraries as (libjack2, alsaLib, qt48Full) grouped in a line, build tools (as llvm and gnumake) in other, auxiliary utilities (coreutils, with, gnused) in another one... You don't need to be overly accurate here, I think you get the general idea...

};

meta = with stdenv.lib; {
description = "FaustLive is a standalone just-in-time Faust compiler";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No self-reference is needed in a small description. You can just rewrite it as

A standalone just-in-time Faust compiler

(No ending period, as you already did).

sha256 = "0sw44yd9928rid9ib0b5mx2x129m7zljrayfm6jz6hrwdc5q3k9a";
};

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meta is supposed to be the last thing in the derivation.


meta = with stdenv.lib; {
description = "FaustLive is a standalone just-in-time Faust compiler";
longDescription = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rewrite that longDescription, always respecting the magic 80-characters limit, and using two chars as indent.
Indeed, this line is so long I need to use the horizontal scrolling bars of my browser.

Another example (mine, again!):

description = "An open-source IA-32 (x86) PC emulator";
longDescription = ''
Bochs is an open-source (LGPL), highly portable IA-32 PC emulator, written
in C++, that runs on most popular platforms. It includes emulation of the
Intel x86 CPU, common I/O devices, and a custom BIOS.
'';

makeFlags = [ "PREFIX=$(out)" ];

buildPhase = ''
substituteInPlace Build/Linux/buildversion --replace "#!/bin/bash" ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be rewritten as

preBuild = "patchShebangs Build/Linux/buildversion";

@ThysBallard
Copy link
Contributor Author

@AndersonTorres Thanks for the tips. Let me know if these changes did the job :)

homepage = http://faust.grame.fr/;
license = licenses.gpl3;
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless newline. It can be removed.

};

}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double newline at the end of file. Leave only one here.

P.S.: there are some spurious whitespaces in your code. They pollute Git logs. Specifically, lines 3, 17 and 19 have endline whitespaces.

@ThysBallard
Copy link
Contributor Author

Hopefully everything is clean and tidy now :)

@AndersonTorres
Copy link
Member

I have tested it locally. It compíles and builds cleanly. If no one else objects, I will merge it tomorrow.

@ThysBallard
Copy link
Contributor Author

@AndersonTorres thanks for all the help! This was my first pull request ever even though I've been programming for years so thanks for dealing with my crap

@AndersonTorres AndersonTorres merged commit 18006f8 into NixOS:master Aug 28, 2018
@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 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