unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#33876] [PATCH]:gnu: Add flat assembler
       [not found] ` <CAOYpmvpofscHr6s+78g7K0NP=8bft7_FSL72dzWkD_F4bvRGcw@mail.gmail.com>
@ 2019-01-05  0:10   ` Kei Kebreau
  2019-01-05  0:11     ` Kei Kebreau
  0 siblings, 1 reply; 4+ messages in thread
From: Kei Kebreau @ 2019-01-05  0:10 UTC (permalink / raw)
  To: Guy fleury; +Cc: 33876

Hi Guy,

Guy fleury <hoonandon@gmail.com> writes:

> From 061c6b7fd399a304d0a0fc089f0020b4f9fa368c Mon Sep 17 00:00:00 2001
> From: guy fleury iteriteka <hoonandon@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!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#33876] [PATCH]:gnu: Add flat assembler
  2019-01-05  0:10   ` [bug#33876] [PATCH]:gnu: Add flat assembler Kei Kebreau
@ 2019-01-05  0:11     ` Kei Kebreau
  2019-01-05 19:45       ` Guy fleury
  0 siblings, 1 reply; 4+ messages in thread
From: Kei Kebreau @ 2019-01-05  0:11 UTC (permalink / raw)
  To: Guy fleury; +Cc: 33876

Also, don't forget to add a copyright line for yourself at the top of
the file!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#33876] [PATCH]:gnu: Add flat assembler
  2019-01-05  0:11     ` Kei Kebreau
@ 2019-01-05 19:45       ` Guy fleury
  2019-01-06  0:33         ` bug#33876: " Kei Kebreau
  0 siblings, 1 reply; 4+ messages in thread
From: Guy fleury @ 2019-01-05 19:45 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: 33876


[-- Attachment #1.1: Type: text/plain, Size: 235 bytes --]

Hi kei,

thanks for your suggestions.
attached update patch.

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

> Also, don't forget to add a copyright line for yourself at the top of
> the file!
>

[-- Attachment #1.2: Type: text/html, Size: 572 bytes --]

[-- Attachment #2: 0001-Add-fasm.patch --]
[-- Type: text/x-patch, Size: 2935 bytes --]

From b6e74c1f6fa24e438f8cff9be2b9e07cd6feb68c Mon Sep 17 00:00:00 2001
From: guy fleury iteriteka <hoonandon@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@enge.fr>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@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)))
+
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#33876: [PATCH]:gnu: Add flat assembler
  2019-01-05 19:45       ` Guy fleury
@ 2019-01-06  0:33         ` Kei Kebreau
  0 siblings, 0 replies; 4+ messages in thread
From: Kei Kebreau @ 2019-01-06  0:33 UTC (permalink / raw)
  To: Guy fleury; +Cc: 33876-done

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@gmail.com> writes:

> Hi kei,
>
> thanks for your suggestions.
> attached update patch.
>
> Le sam. 5 janv. 2019 à 01:11, Kei Kebreau <kkebreau@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@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@enge.fr>
>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2019 Guy Fleury Iteriteka <hoonandon@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)))
> +

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-06  0:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAOYpmvppMQtwt3NTybJE_awNkBxtjbo_tXAiyZs1fdCyHF_NUw@mail.gmail.com>
     [not found] ` <CAOYpmvpofscHr6s+78g7K0NP=8bft7_FSL72dzWkD_F4bvRGcw@mail.gmail.com>
2019-01-05  0:10   ` [bug#33876] [PATCH]:gnu: Add flat assembler Kei Kebreau
2019-01-05  0:11     ` Kei Kebreau
2019-01-05 19:45       ` Guy fleury
2019-01-06  0:33         ` bug#33876: " Kei Kebreau

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).