From b2a2196aafa4a0cb40f76b7731edc9c631f6f5ff Mon Sep 17 00:00:00 2001 From: Marrub Date: Sat, 19 Oct 2019 13:20:17 -0400 Subject: [PATCH] add per-computer configuration files --- applications/fish | 2 + build-system/rebuild-pkginfo.rkt | 31 ++++++++++++ build-system/rebuild-pkgs.rkt | 86 -------------------------------- build-system/rebuild.rkt | 32 +++++++++--- computers/lane/rebuild-pkgs | 2 + {vim => computers/lane}/vconf | 9 ++-- computers/rain/rebuild-pkgs | 46 +++++++++++++++++ computers/rain/vconf | 29 +++++++++++ vim/vimrc | 14 ------ 9 files changed, 139 insertions(+), 112 deletions(-) create mode 100644 build-system/rebuild-pkginfo.rkt delete mode 100755 build-system/rebuild-pkgs.rkt create mode 100644 computers/lane/rebuild-pkgs rename {vim => computers/lane}/vconf (60%) create mode 100644 computers/rain/rebuild-pkgs create mode 100644 computers/rain/vconf diff --git a/applications/fish b/applications/fish index 59c0b41..fd9c325 100644 --- a/applications/fish +++ b/applications/fish @@ -52,6 +52,8 @@ switch (uname) echo (set_color red)"This platform is not configured!" end +set -Ux _agw_dir_local $_agw_dir_rc/computers/(hostname) + # execute scripts if test -f ~/.cargo/env source ~/.cargo/env diff --git a/build-system/rebuild-pkginfo.rkt b/build-system/rebuild-pkginfo.rkt new file mode 100644 index 0000000..a3faddd --- /dev/null +++ b/build-system/rebuild-pkginfo.rkt @@ -0,0 +1,31 @@ +#lang racket/base + +(require racket/format) + +(provide package-options) + +(define (mygit a) (~a "https://git.greyserv.net/packages/" a)) +(define (gitlab a) (~a "https://gitlab.com/" a)) +(define (github a) (~a "https://github.com/" a)) + +(define package-options + (hash + 'bsnes-plus-git + (hash 'url (mygit "bsnes-plus-git.git")) + + 'gmqcc-git + (hash 'url (mygit "gmqcc-git.git")) + + 'minecraft-server-fabric + (hash 'url (mygit "minecraft-server-fabric.git")) + + 'otf-linjapona + (hash 'url (mygit "otf-linjapona.git")) + + 'quakespasm + (hash 'url (mygit "quakespasm.git")) + + 'quakespasm-spiked-git + (hash 'url (mygit "quakespasm-spiked-git.git")))) + +;; EOF diff --git a/build-system/rebuild-pkgs.rkt b/build-system/rebuild-pkgs.rkt deleted file mode 100755 index 4178ab5..0000000 --- a/build-system/rebuild-pkgs.rkt +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env racket -#lang racket/base - -(require racket/format) - -(provide all-packages package-options) - -(define (mygit a) (~a "https://git.greyserv.net/packages/" a)) -(define (gitlab a) (~a "https://gitlab.com/" a)) -(define (github a) (~a "https://github.com/" a)) - -(define all-packages - (list - 'embree2 - 'kmozillahelper - 'libsodium-git - 'wxgtk2-tb - - 'applyppf - 'basiliskii-git - 'bsnes-plus-git - 'cc65 - 'crosstool-ng-git - 'ericw-tools - 'f3 - 'firefox-kde-opensuse-bin - 'gdcc-git - 'gitahead - 'gmqcc-git - 'gopherus - 'gtk3-nocsd-git - 'maxcso - 'megasync - 'megatools - 'minecraft-launcher - 'minecraft-server-fabric - 'motsognir - 'ndstrim - 'obs-linuxbrowser-bin - 'otf-linjapona - 'otf-san-francisco - 'pkgtop-git - 'prboom-plus - 'previous-svn - 'qjoypad - 'quakespasm - 'quakespasm-spiked-git - 'radeontop - 'ripcord - 'sharenix-git - 'sheepshaver-git - 'slade - 'trenchbroom - 'ttf-twemoji-color - 'uade - 'xf86-input-xwiimote-git - 'xwiimote-git - 'yamagi-quake2 - 'zdoom)) - -(define package-options - (hash - 'embree2 (hash 'asdeps #t) - 'kmozillahelper (hash 'asdeps #t) - 'libsodium-git (hash 'asdeps #t) - 'wxgtk2-tb (hash 'asdeps #t) - - 'bsnes-plus-git - (hash 'url (mygit "bsnes-plus-git.git")) - - 'gmqcc-git - (hash 'url (mygit "gmqcc-git.git")) - - 'minecraft-server-fabric - (hash 'url (mygit "minecraft-server-fabric.git")) - - 'otf-linjapona - (hash 'url (mygit "otf-linjapona.git")) - - 'quakespasm - (hash 'url (mygit "quakespasm.git")) - - 'quakespasm-spiked-git - (hash 'url (mygit "quakespasm-spiked-git.git")))) - -;; EOF diff --git a/build-system/rebuild.rkt b/build-system/rebuild.rkt index 0833cfa..80cd86b 100755 --- a/build-system/rebuild.rkt +++ b/build-system/rebuild.rkt @@ -1,12 +1,22 @@ #!/usr/bin/env racket #lang racket/base -(require "rebuild-pkgs.rkt") - (require racket/cmdline) +(require racket/file) (require racket/format) -(require racket/system) +(require racket/list) (require racket/port) +(require racket/system) + +(require "rebuild-pkginfo.rkt") + +(define-values (dependency-packages normal-packages) + (let ([all (file->lines + (build-path (getenv "_agw_dir_local") "rebuild-pkgs") + #:mode 'text)]) + (split-at all (index-of all "")))) + +(define all-packages (append dependency-packages (cdr normal-packages))) (define cwd current-directory) @@ -34,7 +44,7 @@ [clone-url (hash-ref opts 'url (default-pkg-url pkg))] [special-handling (hash-ref opts 'handle 'none)] [branch (hash-ref opts 'branch "master")] - [pkg-dir (build-path (cwd) (symbol->string pkg))]) + [pkg-dir (build-path (cwd) pkg)]) (unless (directory-exists? pkg-dir) (sys (~a "git clone -b " branch " " clone-url))) (parameterize ([cwd pkg-dir]) @@ -46,26 +56,32 @@ "(or/c 'none)" special-handling)]))))) -(define (resume-from-pkg input-pkg [pkg-list all-packages]) +(define (resume-from-pkg input-pkg pkg-list) (let ([package (car pkg-list)]) (if (equal? package input-pkg) pkg-list (resume-from-pkg input-pkg (cdr pkg-list))))) +(define (get-package-options package) + (let ([temp-hash (hash-ref package-options package (hash))]) + (if (member package dependency-packages) + (hash-set temp-hash 'asdeps #t) + temp-hash))) + (let* ([resume-from (make-parameter '())] [cmdline-pkgs (command-line #:once-each ["--resume-from" pkg "Resume compiling from a package." (resume-from pkg)] - #:args pkgs (map string->symbol pkgs))] + #:args pkgs pkgs)] [pkgs (if (null? cmdline-pkgs) (let ([input-package (resume-from)]) (if (null? input-package) all-packages - (resume-from-pkg (string->symbol input-package)))) + (resume-from-pkg input-package all-packages))) cmdline-pkgs)]) (for ([package pkgs]) - (build-pkg package (hash-ref package-options package (hash))))) + (build-pkg package (get-package-options package)))) ;; EOF diff --git a/computers/lane/rebuild-pkgs b/computers/lane/rebuild-pkgs new file mode 100644 index 0000000..3f288fe --- /dev/null +++ b/computers/lane/rebuild-pkgs @@ -0,0 +1,2 @@ + +eternity-engine-git diff --git a/vim/vconf b/computers/lane/vconf similarity index 60% rename from vim/vconf rename to computers/lane/vconf index cf83009..95ca76a 100644 --- a/vim/vconf +++ b/computers/lane/vconf @@ -1,16 +1,17 @@ " vim: syntax=vim: -" settings for workstations - servers need not apply ;) -let _agw.cr_scheme=-1 +let _agw.cr_scheme=0 let _agw.g_columns=80 let _agw.g_rows=24 let _agw.tab_wid=3 let _agw.use_ft=1 let _agw.use_list=1 let _agw.use_number=1 -let _agw.use_rainbow=1 -let _agw.use_ruby=1 +let _agw.use_rainbow=0 +let _agw.use_ruby=0 let _agw.use_tagbar=0 let _agw.use_vsp=0 +let _agw.colors=['badwolf'] + " EOF diff --git a/computers/rain/rebuild-pkgs b/computers/rain/rebuild-pkgs new file mode 100644 index 0000000..0189b0f --- /dev/null +++ b/computers/rain/rebuild-pkgs @@ -0,0 +1,46 @@ +embree2 +kmozillahelper +libsodium-git +wxgtk2-tb + +applyppf +basiliskii-git +bsnes-plus-git +cc65 +crosstool-ng-git +ericw-tools +f3 +firefox-kde-opensuse-bin +gdcc-git +gitahead +gmqcc-git +gopherus +gtk3-nocsd-git +maxcso +megasync +megatools +minecraft-launcher +minecraft-server-fabric +motsognir +ndstrim +obs-linuxbrowser-bin +otf-linjapona +otf-san-francisco +pkgtop-git +prboom-plus +previous-svn +qjoypad +quakespasm +quakespasm-spiked-git +radeontop +ripcord +sharenix-git +sheepshaver-git +slade +trenchbroom +ttf-twemoji-color +uade +xf86-input-xwiimote-git +xwiimote-git +yamagi-quake2 +zdoom diff --git a/computers/rain/vconf b/computers/rain/vconf new file mode 100644 index 0000000..c549785 --- /dev/null +++ b/computers/rain/vconf @@ -0,0 +1,29 @@ +" vim: syntax=vim: + +let _agw.cr_scheme=-1 +let _agw.g_columns=80 +let _agw.g_rows=24 +let _agw.tab_wid=3 +let _agw.use_ft=1 +let _agw.use_list=1 +let _agw.use_number=1 +let _agw.use_rainbow=1 +let _agw.use_ruby=1 +let _agw.use_tagbar=0 +let _agw.use_vsp=0 + +let _agw.colors=[ +\ 'base16-ashes', +\ 'base16-atelier-cave', +\ 'base16-atelier-forest', +\ 'base16-atelier-heath', +\ 'base16-circus', +\ 'base16-dracula', +\ 'base16-material-palenight', +\ 'base16-monokai', +\ 'base16-onedark', +\ 'base16-porple', +\ 'base16-unikitty-dark', +\] + +" EOF diff --git a/vim/vimrc b/vim/vimrc index 6fcc753..cfcf170 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -34,20 +34,6 @@ let _agw.mode_map = { \ 't' : '…!', \} -let _agw.colors=[ -\ 'base16-ashes', -\ 'base16-atelier-cave', -\ 'base16-atelier-forest', -\ 'base16-atelier-heath', -\ 'base16-circus', -\ 'base16-dracula', -\ 'base16-material-palenight', -\ 'base16-monokai', -\ 'base16-onedark', -\ 'base16-porple', -\ 'base16-unikitty-dark', -\] - let _agw.languages=[ \ "c", \ "cpp",