From 9660ddf8d90717680c2c0e0220e677ced5386d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Wed, 26 Feb 2025 13:35:46 -0800 Subject: [PATCH 1/9] Add `awk` --- recipes/awk/build.sh | 9 +++++++++ recipes/awk/meta.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 recipes/awk/build.sh create mode 100644 recipes/awk/meta.yaml diff --git a/recipes/awk/build.sh b/recipes/awk/build.sh new file mode 100644 index 0000000000000..728ec097f1016 --- /dev/null +++ b/recipes/awk/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash -euo + +set -xe + +make -j"${CPU_COUNT}" CC=$CC CFLAGS="$CFLAGS +if [ ! -d ${PREFIX}/bin ] ; then + mkdir -p ${PREFIX}/bin +fi +mv a.out ${PREFIX}/bin/awk diff --git a/recipes/awk/meta.yaml b/recipes/awk/meta.yaml new file mode 100644 index 0000000000000..217de09d575c5 --- /dev/null +++ b/recipes/awk/meta.yaml @@ -0,0 +1,38 @@ +{% set name = "awk" %} +{% set version = "20250116" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + url: https://github.com/onetrueawk/{{ name }}/archive/{{ version }}.tar.gz + sha256: e031b1e1d2b230f276f975bffb923f0ea15f798c839d15a3f26a1a39448e32d7 + +build: + number: 0 + skip: true # [win] + +requirements: + build: + - {{ compiler("c") }} + - make + +test: + commands: + - awk 'BEGIN {print 1+1}' + +about: + home: https://github.com/onetrueawk/awk + license: Lucent Technologies + license_file: LICENSE + summary: One true awk + description: | + This is the version of awk described in The AWK Programming Language, Second + Edition, by Al Aho, Brian Kernighan, and Peter Weinberger (Addison-Wesley, + 2024, ISBN-13 978-0138269722, ISBN-10 0138269726). + dev_url: https://github.com/onetrueawk/awk + +extra: + recipe-maintainers: + - apcamargo From 65555ea78e702459636f6ab4cdf8039c027ba719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Wed, 26 Feb 2025 13:39:49 -0800 Subject: [PATCH 2/9] Add `{{ stdlib("c") }}` --- recipes/awk/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/awk/meta.yaml b/recipes/awk/meta.yaml index 217de09d575c5..2033a1930fe3b 100644 --- a/recipes/awk/meta.yaml +++ b/recipes/awk/meta.yaml @@ -16,6 +16,7 @@ build: requirements: build: - {{ compiler("c") }} + - {{ stdlib("c") }} - make test: From 723a8adb35a76595a8425b1cd5878a6d7c5b16d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Wed, 26 Feb 2025 14:22:45 -0800 Subject: [PATCH 3/9] Fix build.sh --- recipes/awk/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/awk/build.sh b/recipes/awk/build.sh index 728ec097f1016..b218484bc24ba 100644 --- a/recipes/awk/build.sh +++ b/recipes/awk/build.sh @@ -2,7 +2,7 @@ set -xe -make -j"${CPU_COUNT}" CC=$CC CFLAGS="$CFLAGS +make -j"${CPU_COUNT}" CC="$CC" CFLAGS="$CFLAGS" if [ ! -d ${PREFIX}/bin ] ; then mkdir -p ${PREFIX}/bin fi From c7525b5320918d7af928bf83e936d02e8ba2bba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Wed, 26 Feb 2025 14:33:28 -0800 Subject: [PATCH 4/9] Add `bison` as a build dependency --- recipes/awk/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/awk/meta.yaml b/recipes/awk/meta.yaml index 2033a1930fe3b..39096d6aefc4d 100644 --- a/recipes/awk/meta.yaml +++ b/recipes/awk/meta.yaml @@ -18,6 +18,7 @@ requirements: - {{ compiler("c") }} - {{ stdlib("c") }} - make + - bison test: commands: From dc7648c898a398d9eea132a2a6eee23950e0eadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Wed, 26 Feb 2025 15:07:04 -0800 Subject: [PATCH 5/9] Update build.sh --- recipes/awk/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/awk/build.sh b/recipes/awk/build.sh index b218484bc24ba..6fafa828fc82e 100644 --- a/recipes/awk/build.sh +++ b/recipes/awk/build.sh @@ -2,7 +2,7 @@ set -xe -make -j"${CPU_COUNT}" CC="$CC" CFLAGS="$CFLAGS" +make if [ ! -d ${PREFIX}/bin ] ; then mkdir -p ${PREFIX}/bin fi From e387f22384ac4e30422732ff318fd41cecaccc90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Wed, 26 Feb 2025 15:34:00 -0800 Subject: [PATCH 6/9] Update build.sh --- recipes/awk/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/awk/build.sh b/recipes/awk/build.sh index 6fafa828fc82e..d0f901eed1517 100644 --- a/recipes/awk/build.sh +++ b/recipes/awk/build.sh @@ -2,7 +2,7 @@ set -xe -make +make CC="gcc -Wall" if [ ! -d ${PREFIX}/bin ] ; then mkdir -p ${PREFIX}/bin fi From 827a8de5eb98ab9aa74a7a1cb34ca34d87d7857e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Thu, 27 Feb 2025 09:20:18 -0800 Subject: [PATCH 7/9] Prevent conflicts with `gawk` --- recipes/awk/build.sh | 2 +- recipes/awk/meta.yaml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/recipes/awk/build.sh b/recipes/awk/build.sh index d0f901eed1517..6fafa828fc82e 100644 --- a/recipes/awk/build.sh +++ b/recipes/awk/build.sh @@ -2,7 +2,7 @@ set -xe -make CC="gcc -Wall" +make if [ ! -d ${PREFIX}/bin ] ; then mkdir -p ${PREFIX}/bin fi diff --git a/recipes/awk/meta.yaml b/recipes/awk/meta.yaml index 39096d6aefc4d..fccf8d6c60c56 100644 --- a/recipes/awk/meta.yaml +++ b/recipes/awk/meta.yaml @@ -19,6 +19,8 @@ requirements: - {{ stdlib("c") }} - make - bison + run_constrained: + - gawk ==9999999999 test: commands: @@ -26,9 +28,9 @@ test: about: home: https://github.com/onetrueawk/awk - license: Lucent Technologies + license: LicenseRef-Lucent-Technologies license_file: LICENSE - summary: One true awk + summary: One true awk description: | This is the version of awk described in The AWK Programming Language, Second Edition, by Al Aho, Brian Kernighan, and Peter Weinberger (Addison-Wesley, From 66b439719548ef43b0b7626336652420a4b17d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Thu, 27 Feb 2025 09:57:23 -0800 Subject: [PATCH 8/9] Set CC --- recipes/awk/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/awk/build.sh b/recipes/awk/build.sh index 6fafa828fc82e..d804a823457e6 100644 --- a/recipes/awk/build.sh +++ b/recipes/awk/build.sh @@ -2,7 +2,7 @@ set -xe -make +make CC=$CC if [ ! -d ${PREFIX}/bin ] ; then mkdir -p ${PREFIX}/bin fi From 6140891b94bf269a432cd8240f7c91dfce8e46bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Thu, 27 Feb 2025 13:31:07 -0800 Subject: [PATCH 9/9] Set `$HOSTCC` --- recipes/awk/build.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/recipes/awk/build.sh b/recipes/awk/build.sh index d804a823457e6..2a6000de7f9b3 100644 --- a/recipes/awk/build.sh +++ b/recipes/awk/build.sh @@ -2,8 +2,16 @@ set -xe -make CC=$CC +# If running in Linux, set the `$HOSTCC` manually to +# avoid calling the hardcoded `cc` command in the makefile +if [ "$(uname)" = "Linux" ]; then + make HOSTCC="$CC -g -Wall -pedantic -Wcast-qual" +else + make +fi + if [ ! -d ${PREFIX}/bin ] ; then mkdir -p ${PREFIX}/bin fi + mv a.out ${PREFIX}/bin/awk