GNU bug report logs - #33876
[PATCH]:gnu: Add flat assembler

Previous Next

Package: guix-patches;

Reported by: Guy fleury <hoonandon <at> gmail.com>

Date: Wed, 26 Dec 2018 09:19:02 UTC

Severity: normal

Tags: patch

Done: Kei Kebreau <kkebreau <at> posteo.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33876 in the body.
You can then email your comments to 33876 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#33876; Package guix-patches. (Wed, 26 Dec 2018 09:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Guy fleury <hoonandon <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Wed, 26 Dec 2018 09:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Guy fleury <hoonandon <at> gmail.com>
To: Guix-patches <at> gnu.org
Subject: [PATCH]:gnu: Add flat assembler
Date: Wed, 26 Dec 2018 10:18:33 +0100
[Message part 1 (text/plain, inline)]
hi guix,

This patch add flat assembler

if it's not good, give me aditional information to polish it.
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#33876; Package guix-patches. (Wed, 26 Dec 2018 09:53:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Guy fleury <hoonandon <at> gmail.com>
To: Guix-patches <at> gnu.org
Subject: Re: [PATCH]:gnu: Add flat assembler
Date: Wed, 26 Dec 2018 10:40:57 +0100
[Message part 1 (text/plain, inline)]
attach file

Le mer. 26 déc. 2018 à 10:18, Guy fleury <hoonandon <at> gmail.com> a écrit :

> hi guix,
>
> This patch add flat assembler
>
> if it's not good, give me aditional information to polish it.
>
[Message part 2 (text/html, inline)]
[0001-gnu-Add-flat-assembler.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#33876; Package guix-patches. (Sat, 05 Jan 2019 00:11:01 GMT) Full text and rfc822 format available.

Message #11 received at 33876 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kkebreau <at> posteo.net>
To: Guy fleury <hoonandon <at> gmail.com>
Cc: 33876 <at> debbugs.gnu.org
Subject: Re: [bug#33876] [PATCH]:gnu: Add flat assembler
Date: Fri, 04 Jan 2019 19:10:21 -0500
Hi Guy,

Guy fleury <hoonandon <at> gmail.com> writes:

> From 061c6b7fd399a304d0a0fc089f0020b4f9fa368c Mon Sep 17 00:00:00 2001
> From: guy fleury iteriteka <hoonandon <at> gmail.com>
> Date: Wed, 26 Dec 2018 09:39:23 +0100
> Subject: [PATCH] gnu:Add flat assembler
>
> ---
>  gnu/packages/assembly.scm | 56 ++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 55 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/assembly.scm b/gnu/packages/assembly.scm
> index 763d183cf..34832bad2 100644
> --- a/gnu/packages/assembly.scm
> +++ b/gnu/packages/assembly.scm
> @@ -30,7 +30,9 @@
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages texinfo)
>    #:use-module (gnu packages python)
> -  #:use-module (gnu packages xml))
> +  #:use-module (gnu packages xml)
> +  #:use-module ((guix utils)
> +                #:select (%current-system)))
>  
>  (define-public nasm
>    (package
> @@ -122,3 +124,55 @@ abstracts over the target CPU by exposing a standardized RISC instruction set
>  to the clients.")
>      (home-page "https://www.gnu.org/software/lightning/")
>      (license license:gpl3+)))
> +
> +(define-public fasm
> +  (package
> +    (name "fasm")
> +    (version "1.73.04")

Since you've submitted this patch, the newest version has become
1.73.06. This is not a difficult change at all.

> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://flatassembler.net/fasm-"
> +                           version ".tgz"))
> +       (sha256
> +        (base32
> +         "0y0xkf9fzcm5gklhdi61wjpd1p8islpbcnkv5k16aqci3qsd0ia1"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure) ;;no configure script used
> +         (replace 'build
> +           (lambda _
> +             ;;source code are in this directory
> +             (chdir "source/Linux/")
> +             (if (string=? ,(%current-system) "x86_64-linux") ;;if x86_86

I believe you meant "if x86_64" in this comment? Anyway, it is not
necessary, as it is easy to see what is going on here.

> +                 ;;use pre-binarie in /root directory to build itself

Instead of "/root directory", I'd say "top-level directory", and
instead of "pre-binarie" we typically refer to these as "pre-compiled
binaries".

Also, we try to avoid relying on pre-compiled binaries to build
software, but it seems that fasm is strictly self-building.

> +                 (invoke "../../fasm.x64" "fasm.asm")
> +
> +                 (invoke "../../fasm" "fasm.asm")))) ;;the same with i686
> +
> +         (replace 'install
> +           (lambda _
> +             (let ((out (assoc-ref %outputs "out")))
> +               (begin
> +                 ;;delete pre-binaries
> +                 ;;this make sure not copy them
> +                 ;;instead of the one recentently build
> +                 (for-each delete-file '("../../fasm" "../../fasm.x64"))

You shouldn't need to remove these because the recently built fasm is
clearly in the current directory by itself.

> +                 (mkdir-p (string-append out "/bin"))
> +                 ;;copy the excutable recentently build in /source/Linux/fasm
> +                 ;;the excutable name is fasm
> +                 (copy-file "fasm" (string-append out "/bin/fasm"))))))

You can use the 'install-file' procedure here instead of
'copy-file'. This way you don't have to worry about naming the
file, the directory you install to is automatically created and your
intentions are clearer. See the difference:

(mkdir-p (string-append out "/bin"))
(copy-file "fasm" (string-append out "/bin/fasm"))

vs.

(install-file "fasm" (string-append out "/bin"))

Also please make sure that the install phase returns #t so Guix doesn't
show its "phase returned `#<unspecified>'" warning.

> +
> +         (delete 'check)))) ;;no test

Instead of deleting the check phase manually, you can use #f as an
argument to the keyword #:tests?. While you do that, also use #f as an
argument to the keyword #:strip-binaries? because strip reports that
fasm's binary doesn't have sections in it, so stripping the debug
section from the binary would have no effect.

(arguments
 `(#:tests? #f ; no tests
   #:strip-binaries? #f ; fasm has no sections.
   #:phases ...

> +    ;;support only intel x86 family processors
> +    (supported-systems '("x86_64-linux" "i686-linux"))
> +    (synopsis "Assembler for x86 processors")
> +    (description
> +     "FASM is a assembler that supports x86, and IA-64 Intel architectures.It
> +does multiple passes to optimize machine code.It have macro abilities and focus on

We like to keep our line lengths below 80 characters, and it is easily
fixed in this case by moving "on" to the next line.

> +operating system portability.")
> +    (home-page "https://flatassembler.net/")
> +    (license license:bsd-2)))
> +

Please reply with a patch with the above corrections. Thanks for
packaging this!




Information forwarded to guix-patches <at> gnu.org:
bug#33876; Package guix-patches. (Sat, 05 Jan 2019 00:13:02 GMT) Full text and rfc822 format available.

Message #14 received at 33876 <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kkebreau <at> posteo.net>
To: Guy fleury <hoonandon <at> gmail.com>
Cc: 33876 <at> debbugs.gnu.org
Subject: Re: [bug#33876] [PATCH]:gnu: Add flat assembler
Date: Fri, 04 Jan 2019 19:11:56 -0500
Also, don't forget to add a copyright line for yourself at the top of
the file!




Information forwarded to guix-patches <at> gnu.org:
bug#33876; Package guix-patches. (Sat, 05 Jan 2019 19:47:01 GMT) Full text and rfc822 format available.

Message #17 received at 33876 <at> debbugs.gnu.org (full text, mbox):

From: Guy fleury <hoonandon <at> gmail.com>
To: Kei Kebreau <kkebreau <at> posteo.net>
Cc: 33876 <at> debbugs.gnu.org
Subject: Re: [bug#33876] [PATCH]:gnu: Add flat assembler
Date: Sat, 5 Jan 2019 20:45:30 +0100
[Message part 1 (text/plain, inline)]
Hi kei,

thanks for your suggestions.
attached update patch.

Le sam. 5 janv. 2019 à 01:11, Kei Kebreau <kkebreau <at> posteo.net> a écrit :

> Also, don't forget to add a copyright line for yourself at the top of
> the file!
>
[Message part 2 (text/html, inline)]
[0001-Add-fasm.patch (text/x-patch, attachment)]

Reply sent to Kei Kebreau <kkebreau <at> posteo.net>:
You have taken responsibility. (Sun, 06 Jan 2019 00:34:04 GMT) Full text and rfc822 format available.

Notification sent to Guy fleury <hoonandon <at> gmail.com>:
bug acknowledged by developer. (Sun, 06 Jan 2019 00:34:04 GMT) Full text and rfc822 format available.

Message #22 received at 33876-done <at> debbugs.gnu.org (full text, mbox):

From: Kei Kebreau <kkebreau <at> posteo.net>
To: Guy fleury <hoonandon <at> gmail.com>
Cc: 33876-done <at> debbugs.gnu.org
Subject: Re: [bug#33876] [PATCH]:gnu: Add flat assembler
Date: Sat, 05 Jan 2019 19:33:36 -0500
I've formatted your change log according to the GNU Coding Standards
(https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html)
and pushed your change to master.

Thanks for your contribution!

Guy fleury <hoonandon <at> gmail.com> writes:

> Hi kei,
>
> thanks for your suggestions.
> attached update patch.
>
> Le sam. 5 janv. 2019 à 01:11, Kei Kebreau <kkebreau <at> posteo.net> a écrit :
>
>  Also, don't forget to add a copyright line for yourself at the top of
>  the file!
>
> From b6e74c1f6fa24e438f8cff9be2b9e07cd6feb68c Mon Sep 17 00:00:00 2001
> From: guy fleury iteriteka <hoonandon <at> gmail.com>
> Date: Sat, 5 Jan 2019 20:24:08 +0100
> Subject: [PATCH] Add fasm
>
> ---
>  gnu/packages/assembly.scm | 49 ++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 48 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/assembly.scm b/gnu/packages/assembly.scm
> index 763d183cf..c5dbb1746 100644
> --- a/gnu/packages/assembly.scm
> +++ b/gnu/packages/assembly.scm
> @@ -4,6 +4,7 @@
>  ;;; Copyright © 2013 Andreas Enge <andreas <at> enge.fr>
>  ;;; Copyright © 2016 Efraim Flashner <efraim <at> flashner.co.il>
>  ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
> +;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon <at> gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -30,7 +31,9 @@
>    #:use-module (gnu packages perl)
>    #:use-module (gnu packages texinfo)
>    #:use-module (gnu packages python)
> -  #:use-module (gnu packages xml))
> +  #:use-module (gnu packages xml)
> +  #:use-module ((guix utils)
> +                #:select (%current-system)))
>  
>  (define-public nasm
>    (package
> @@ -122,3 +125,47 @@ abstracts over the target CPU by exposing a standardized RISC instruction set
>  to the clients.")
>      (home-page "https://www.gnu.org/software/lightning/")
>      (license license:gpl3+)))
> +
> +(define-public fasm
> +  (package
> +    (name "fasm")
> +    (version "1.73.06")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "https://flatassembler.net/fasm-"
> +                           version ".tgz"))
> +       (sha256
> +        (base32
> +         "02wqkqxpn3p0iwcagsm92qd9cdfcnbx8a09qg03b3pjppp30hmp6"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:tests? #f ;;no tests
> +       #:strip-binaries? #f ;; fasm has no sections
> +       #:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure) ;;no configure script used
> +         (replace 'build
> +           (lambda _
> +             ;;source code are in this directory
> +             (chdir "source/Linux/")
> +             (if (string=? ,(%current-system) "x86_64-linux")
> +                 ;;use pre-compiled in top-level directory to build itself
> +                 (invoke "../../fasm.x64" "fasm.asm")
> +                 (invoke "../../fasm" "fasm.asm"))))
> +
> +         (replace 'install
> +           (lambda _
> +             (let ((out (assoc-ref %outputs "out")))
> +               (install-file "fasm" (string-append out "/bin")))
> +             #t)))))
> +    ;;support only intel x86 family processors
> +    (supported-systems '("x86_64-linux" "i686-linux"))
> +    (synopsis "Assembler for x86 processors")
> +    (description
> +     "FASM is a assembler that supports x86, and IA-64 Intel architectures.
> +It does multiple passes to optimize machine code.It have macro abilities and
> +focus on operating system portability.")
> +    (home-page "https://flatassembler.net/")
> +    (license license:bsd-2)))
> +




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Feb 2019 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.