From 98fa76b0ba07da9e7e99117dd3aab7549647b858 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Sun, 15 Mar 2020 22:21:30 +0000 Subject: [PATCH 01/29] Straight installation funciton has been added Signed-off-by: Sameer Rahmani --- .gitignore | 3 ++- lib/fg42.el | 2 ++ lib/fpkg.el | 58 +++++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index b1409d6..41255ae 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ nohup.out lib/**/*.elc *.elc tmp/ -test-runner/ \ No newline at end of file +test-runner/ +.fpkg/ \ No newline at end of file diff --git a/lib/fg42.el b/lib/fg42.el index 6e9ea25..d534305 100644 --- a/lib/fg42.el +++ b/lib/fg42.el @@ -30,6 +30,8 @@ (defvar fg42-tmp (concat fg42-home "/tmp")) (require 'fpkg) +(fpkg-initialize-once) + (require 'fg42/base) (require 'fg42/splash) (require 'fg42/race) diff --git a/lib/fpkg.el b/lib/fpkg.el index 5c4d8c6..0676f8b 100644 --- a/lib/fpkg.el +++ b/lib/fpkg.el @@ -1,7 +1,7 @@ ;;; fpkg --- a simple package manager for FG42 -*- lexical-binding: t; -*- - -;; Copyright (C) 2010-2019 Sameer Rahmani - +;; +;; Copyright (C) 2010-2012 Sameer Rahmani +;; ;; Author: Sameer Rahmani ;; Keywords: lisp fg42 IDE package manager ;; Version: 1.0.0 @@ -36,6 +36,18 @@ (path nil) (source 'elpa)) + +(defvar bootstrap-version nil + "Bootstrap version of straight. This var is used in straight's installer.") + + +(defvar fpkg-packages-path + (expand-file-name ".fpkg/" fg42-home) + "The path to the directory which FPKG will use to store that packages.") + +(defvar fpkg-initilized-p nil + "A boolean flag that indicates whether FPKG is initialized or not.") + (defvar required-packages (make-hash-table) "A hash of `fg42-package structure representing required packages.") @@ -49,8 +61,9 @@ (setq result nil))) result)) + (defun install--package (pkg) - "Intall a package via its propreate source." + "Install a package via its propreate source." (let* ((source (fpkg-dependency-source pkg)) (func-name (concat "install-package-via-" (symbol-name source))) (install-func @@ -58,7 +71,8 @@ (intern func-name)))) (funcall install-func pkg))) -(defun fpkg-initialize () + +(defun fpkg-initialize-old () "Initilize the package.el and related stuff to be used in FG42" (let ((packages (hash-table-values required-packages))) @@ -86,11 +100,39 @@ (install--package pkg)))))) +(defun fpkg-initialize () + "Initilize the straight.e package manager and setup necessary hooks." + (let ((bootstrap-file (concat fpkg-packages-path + "straight/repos/straight.el/bootstrap.el")) + (bootstrap-version 5)) -(defun depends-on (pkgname &rest args) - "Global function to specify a single dependency" + (make-directory fpkg-packages-path t) + (setq straight-base-dir fpkg-packages-path) + (if (not (file-exists-p bootstrap-file)) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp)) + (load bootstrap-file nil 'nomessage)))) + + +(defun fpkg-initialize-once () + "Initilize FPKG only once." + (when (not fpkg-initilized-p) + (fpkg-initialize))) + + +(defun depends-on-old (pkgname &rest args) + "Install the given PKGNAME if it isn't installed. Ignore ARGS for now." (let ((pkg (apply 'make-fpkg-dependency :name pkgname args))) (puthash pkgname pkg required-packages))) -(message "FPKG has been initialized.") +(defun depends-on (pkgname) + "Install the given PKGNAME if it isn't installed." + (straight-use-package pkgname)) + + (provide 'fpkg) +;;; fpkg.el ends here From 24f839bb7863a566cacefff7147fd5b51f6036ab Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Sun, 15 Mar 2020 22:38:51 +0000 Subject: [PATCH 02/29] Old functions have been removed from fpkg.el Signed-off-by: Sameer Rahmani --- lib/fpkg.el | 53 ----------------------------------------------------- 1 file changed, 53 deletions(-) diff --git a/lib/fpkg.el b/lib/fpkg.el index 0676f8b..ea1cfb6 100644 --- a/lib/fpkg.el +++ b/lib/fpkg.el @@ -52,54 +52,6 @@ "A hash of `fg42-package structure representing required packages.") ;; Functions ---------------------------------- -(defun all-dependencies-installed? () - "Return t if all the dependencies installed." - (let ((result t)) - (dolist (pkg (hash-table-keys required-packages)) - (when (not (package-installed-p pkg)) - (message "'%s' package is not installed" pkg) - (setq result nil))) - result)) - - -(defun install--package (pkg) - "Install a package via its propreate source." - (let* ((source (fpkg-dependency-source pkg)) - (func-name (concat "install-package-via-" (symbol-name source))) - (install-func - (symbol-function - (intern func-name)))) - (funcall install-func pkg))) - - -(defun fpkg-initialize-old () - "Initilize the package.el and related stuff to be used in FG42" - (let ((packages (hash-table-values required-packages))) - - (require 'package) - - (add-to-list 'package-archives - '("melpa" . "http://melpa.org/packages/") t) - (when (< emacs-major-version 24) - ;; For important compatibility libraries like cl-lib - (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) - - ;; Initialize package.el - (package-initialize) - - (setq url-http-attempt-keepalives nil) - - (unless (all-dependencies-installed?) - ;; check for new packages (package versions) - (message "%s" "Refreshing package database...") - (package-refresh-contents) - - ;; install the missing packages - (dolist (pkg packages) - (when (not (package-installed-p (fpkg-dependency-name pkg))) - (install--package pkg)))))) - - (defun fpkg-initialize () "Initilize the straight.e package manager and setup necessary hooks." (let ((bootstrap-file (concat fpkg-packages-path @@ -124,11 +76,6 @@ (fpkg-initialize))) -(defun depends-on-old (pkgname &rest args) - "Install the given PKGNAME if it isn't installed. Ignore ARGS for now." - (let ((pkg (apply 'make-fpkg-dependency :name pkgname args))) - (puthash pkgname pkg required-packages))) - (defun depends-on (pkgname) "Install the given PKGNAME if it isn't installed." (straight-use-package pkgname)) From dd5209d56565c2ffa8c76e8b14db005b3d4a86a8 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 03:44:39 +0330 Subject: [PATCH 03/29] add gitlabCI file --- .gitlab-ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..793c996 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,12 @@ +stages: + - build + +build: + image: ubuntu + stage: build + before_script: + apt install emacs + make install + touch empty.el + script: + fg42 --script empty.el From ed6df5d24d62c869a45bc3096ea43a08b923a95d Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 03:45:47 +0330 Subject: [PATCH 04/29] fix --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 793c996..c8a7e1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,8 @@ build: image: ubuntu stage: build before_script: - apt install emacs - make install - touch empty.el + - apt install emacs + - make install + - touch empty.el script: - fg42 --script empty.el + - fg42 --script empty.el From 14977ad68fc823052045f7eeb74f0a2e88f6a0c6 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 03:46:58 +0330 Subject: [PATCH 05/29] add apt update --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c8a7e1f..91dfeed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: ubuntu stage: build before_script: - - apt install emacs + - sudo apt update && sudo apt install emacs - make install - touch empty.el script: From 10db5f80afbc74f87af09a114e604d88ea85e5a8 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 03:48:04 +0330 Subject: [PATCH 06/29] another fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 91dfeed..0efdeb6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: ubuntu stage: build before_script: - - sudo apt update && sudo apt install emacs + - apt update && apt install emacs - make install - touch empty.el script: From 7a785c55dccb7e0dfdc4a574ca09190c987f405f Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 03:49:44 +0330 Subject: [PATCH 07/29] another fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0efdeb6..3a37808 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: ubuntu stage: build before_script: - - apt update && apt install emacs + - apt update && apt install -y emacs - make install - touch empty.el script: From e80f00bcbf462ad062921e56dbb9b621bbb0a15f Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 03:57:28 +0330 Subject: [PATCH 08/29] add make to installation --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a37808..3442007 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: ubuntu stage: build before_script: - - apt update && apt install -y emacs + - apt update && apt install -y make emacs - make install - touch empty.el script: From d86d470039fc7f9319e5663ce65d0e4007c37af2 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 04:00:10 +0330 Subject: [PATCH 09/29] add wget --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3442007..218c1a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: ubuntu stage: build before_script: - - apt update && apt install -y make emacs + - apt update && apt install -y make wget emacs - make install - touch empty.el script: From d903426e210dcd7e6f57c1a8a1556eb1e13f6602 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 04:03:02 +0330 Subject: [PATCH 10/29] add sudo as well --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 218c1a6..546cdb0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: ubuntu stage: build before_script: - - apt update && apt install -y make wget emacs + - apt update && apt install -y make wget sudo emacs - make install - touch empty.el script: From 34b17b1f412a6f59af9dac5484681a33d269cfcc Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 04:05:58 +0330 Subject: [PATCH 11/29] add git --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 546cdb0..0cb6798 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: ubuntu stage: build before_script: - - apt update && apt install -y make wget sudo emacs + - apt update && apt install -y make wget sudo git emacs - make install - touch empty.el script: From 414cca7f871841749a8147077025d054322ccb6d Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 04:18:58 +0330 Subject: [PATCH 12/29] some changes --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0cb6798..96097f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ build: stage: build before_script: - apt update && apt install -y make wget sudo git emacs - - make install - - touch empty.el + - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ + - cd .fg42 && make install && touch empty.el script: - fg42 --script empty.el From 0a4ecd38c5dbf6295197c46c99cb4a460ee37132 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 04:21:56 +0330 Subject: [PATCH 13/29] some changes --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 96097f0..8ce14ea 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,6 @@ build: stage: build before_script: - apt update && apt install -y make wget sudo git emacs - - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ - - cd .fg42 && make install && touch empty.el + - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd .fg42 && make install && touch empty.el script: - fg42 --script empty.el From af1d5ab1afffc2413cf1327022c857a7db97479b Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 04:26:23 +0330 Subject: [PATCH 14/29] another fix --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8ce14ea..3a646cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,6 @@ build: stage: build before_script: - apt update && apt install -y make wget sudo git emacs - - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd .fg42 && make install && touch empty.el + - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - fg42 --script empty.el From aec7d4d38f778f178dd05eeaf802f2193967a982 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 06:18:07 +0330 Subject: [PATCH 15/29] change --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a646cd..bb9ea67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,4 +8,4 @@ build: - apt update && apt install -y make wget sudo git emacs - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - - fg42 --script empty.el + - cd ~/.fg42/ && emacs --name FG42 --no-site-file --no-site-lisp --no-splash --title FG42 -l ./fg42-config.el --debug-init --script empty.el From d1a1b367aca610f634e16aefbab8a73bde0f3be0 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 06:20:05 +0330 Subject: [PATCH 16/29] change --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb9ea67..6692048 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,4 +8,4 @@ build: - apt update && apt install -y make wget sudo git emacs - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - - cd ~/.fg42/ && emacs --name FG42 --no-site-file --no-site-lisp --no-splash --title FG42 -l ./fg42-config.el --debug-init --script empty.el + - ls -al && emacs --name FG42 --no-site-file --no-site-lisp --no-splash --title FG42 -l ./fg42-config.el --debug-init --script empty.el From e078f31c3df53cdb9fd67b21a162a6c51f2aea58 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 06:22:53 +0330 Subject: [PATCH 17/29] change --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6692048..20b0cc5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,4 +8,4 @@ build: - apt update && apt install -y make wget sudo git emacs - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - - ls -al && emacs --name FG42 --no-site-file --no-site-lisp --no-splash --title FG42 -l ./fg42-config.el --debug-init --script empty.el + - ls -al && emacs --name FG42 --no-site-file --no-site-lisp --no-splash --title FG42 -l ~/.fg42/fg42-config.el --debug-init --script empty.el From 0328d71fa8d1c94f4f89667ddd8ed6c701f26529 Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 06:26:04 +0330 Subject: [PATCH 18/29] back --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 20b0cc5..3a646cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,4 +8,4 @@ build: - apt update && apt install -y make wget sudo git emacs - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - - ls -al && emacs --name FG42 --no-site-file --no-site-lisp --no-splash --title FG42 -l ~/.fg42/fg42-config.el --debug-init --script empty.el + - fg42 --script empty.el From 0f341bcf9b98e4fdb25facb47be8c0d9b67923cf Mon Sep 17 00:00:00 2001 From: amirrezaask Date: Mon, 16 Mar 2020 06:28:24 +0330 Subject: [PATCH 19/29] change --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a646cd..2bde44b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,4 +8,4 @@ build: - apt update && apt install -y make wget sudo git emacs - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - - fg42 --script empty.el + - fg42 -nw --script empty.el From aeae8b5f06474d6422a962aad850f2be885071ed Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 18:32:42 +0000 Subject: [PATCH 20/29] install-ci target has been added to make file --- .gitlab-ci.yml | 6 +++--- Makefile | 23 ++++++++++++++++++----- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2bde44b..9e91d5f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,10 +2,10 @@ stages: - build build: - image: ubuntu + image: debian:stable-slim stage: build before_script: - - apt update && apt install -y make wget sudo git emacs - - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el + - apt update && apt install -y make wget git emacs + - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install-ci && touch empty.el script: - fg42 -nw --script empty.el diff --git a/Makefile b/Makefile index 667102f..e538a7d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,22 @@ +.PHONY: update update: @git remote set-url origin git://gitlab.com/FG42/FG42.git @git pull origin master + +.PHONY: install-cli +install-ci: + @echo "Downloading and installing fonts..." + @mkdir -p ~/.fonts + @wget "https://github.com/FG42/fonts/archive/0.1.0.tar.gz" -O ~/.fonts/fg42.tar.gz + @tar zxf ~/.fonts/fg42.tar.gz -C ~/.fonts --strip 1 + @cp ./config/fg42.user.el ${HOME}/.fg42.el + @echo "Creating the link..." + @echo "#! /bin/sh" > ./fg42 + @echo "export FG42_HOME=$(shell pwd)" >> ./fg42 + @echo 'emacs --name FG42 --no-site-file --no-site-lisp --no-splash --title FG42 -l $$FG42_HOME/fg42-config.el "$$@"' >> ./fg42 + @chmod +x ./fg42 + +.PHONY: install install: @echo "Downloading and installing fonts..." @mkdir -p ~/.fonts @@ -21,11 +37,8 @@ install: @echo "------------------------------------------------------------------------------------" @echo "Make sure to install external dependencies of FG42. For more info checkout README.md" @echo "Enjoy the bless of GNU/Emacs and FG42 :)" + +.PHONY: install-fonts install-fonts: @mkdir -p ~/.fonts/ @cp -rv ./share/fonts/vazir/* ~/.fonts/ -build-image: - docker build . -t fg42:1 --build-arg emacs_version=26.3 - -clean-image: - docker rmi fg42:1 From e0d2de1592cbd3265d58ffc9ead594e6292282f5 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 18:44:45 +0000 Subject: [PATCH 21/29] Path to fg42 executable has been fixed in gitlab-ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9e91d5f..8af11bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,4 +8,4 @@ build: - apt update && apt install -y make wget git emacs - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install-ci && touch empty.el script: - - fg42 -nw --script empty.el + - ~/.fg42/.fg42 -nw --script empty.el From 4e2a210914b12f86a45237039a238b618afead87 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 18:55:13 +0000 Subject: [PATCH 22/29] Path to fg42 executable has been fixed in gitlab-ci --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8af11bd..84f25f7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,4 +8,4 @@ build: - apt update && apt install -y make wget git emacs - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install-ci && touch empty.el script: - - ~/.fg42/.fg42 -nw --script empty.el + - ~/.fg42/fg42 -nw --script empty.el From 7075846b7f2b4e4b9cb2debc758f19e0dcc5ba64 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 19:07:38 +0000 Subject: [PATCH 23/29] Changed the install target back ot install instead of install-ci --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 84f25f7..8173a41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,6 @@ build: stage: build before_script: - apt update && apt install -y make wget git emacs - - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install-ci && touch empty.el + - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - - ~/.fg42/fg42 -nw --script empty.el + - fg42 -nw --script empty.el && echo "Done" From 59f6e3c56fe62b2efbf1efe62320443a24e221eb Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 19:11:48 +0000 Subject: [PATCH 24/29] Added back 'sudo' to the dependency list --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8173a41..3bcf772 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: debian:stable-slim stage: build before_script: - - apt update && apt install -y make wget git emacs + - apt update && apt install -y make wget git emacs suod - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - fg42 -nw --script empty.el && echo "Done" From ea2ede68a39f84220e3785894ec225a1672f0385 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 19:12:59 +0000 Subject: [PATCH 25/29] Fixed a typo in dependencies list --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3bcf772..f6a4655 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ build: image: debian:stable-slim stage: build before_script: - - apt update && apt install -y make wget git emacs suod + - apt update && apt install -y make wget git emacs sudo - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - fg42 -nw --script empty.el && echo "Done" From 0dbebb14bfd72051a85ac506ad8e8301eb3d4008 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 19:38:52 +0000 Subject: [PATCH 26/29] Added -l flag to the fg42 command on gitlab ci script --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f6a4655..09f01d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,6 @@ build: stage: build before_script: - apt update && apt install -y make wget git emacs sudo - - git clone https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el + - git clone -b fpkg-v2 https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el script: - - fg42 -nw --script empty.el && echo "Done" + - fg42 -nw -l ~/.fg42/fg42-config.el --script empty.el From bafd15460b49d64fd8df88ca9d2cbcbf8cb86c88 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 20:58:56 +0000 Subject: [PATCH 27/29] build.el has been added --- .gitlab-ci.yml | 4 ++-- build.el | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 build.el diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09f01d8..9d3fceb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,6 @@ build: stage: build before_script: - apt update && apt install -y make wget git emacs sudo - - git clone -b fpkg-v2 https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && touch empty.el + - git clone -b fpkg-v2 https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install script: - - fg42 -nw -l ~/.fg42/fg42-config.el --script empty.el + - fg42 -nw --script build.el diff --git a/build.el b/build.el new file mode 100644 index 0000000..b005646 --- /dev/null +++ b/build.el @@ -0,0 +1,21 @@ +(add-to-list 'load-path (concat (getenv "HOME") ".fg42/lib")) + +(defvar bootstrap-version nil + "Bootstrap version of straight. This var is used in straight's installer.") + +(defun fpkg-initialize () + "Initilize the straight.e package manager and setup necessary hooks." + (let ((bootstrap-file "~/.fg42/.fpkg/straight/repos/straight.el/bootstrap.el") + (bootstrap-version 5)) + + (setq straight-base-dir "~/.fg42/.fpkg/") + (if (not (file-exists-p bootstrap-file)) + (with-current-buffer + (url-retrieve-synchronously + "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" + 'silent 'inhibit-cookies) + (goto-char (point-max)) + (eval-print-last-sexp)) + (load bootstrap-file nil 'nomessage)))) + +(fpkg-initialize) From e7f9456790c7c8704e9441ad332fda5de5ce62ca Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 21:34:29 +0000 Subject: [PATCH 28/29] build-package task has been added to the CI pipeline --- .gitlab-ci.yml | 15 ++++++++++++++- build.el | 26 ++++++++++++++++++++++++++ lib/fpkg.el | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d3fceb..64278bf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,6 +6,19 @@ build: stage: build before_script: - apt update && apt install -y make wget git emacs sudo - - git clone -b fpkg-v2 https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install + - git clone -b fpkg-v2 https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && cd script: - fg42 -nw --script build.el + +build-package: + extends: build + script: + - fg42 -nw --script build.el + - tar zcf fg42.$CI_COMMIT_TAG.tar.gz ~/.fg42/ + artifacts: + when: on_success + paths: + - ~/fg42.$CI_COMMIT_TAG.tar.gz + only: + - tags + - master diff --git a/build.el b/build.el index b005646..8eb8c20 100644 --- a/build.el +++ b/build.el @@ -1,3 +1,26 @@ +;;; build --- build script for FG42 +;; +;; Copyright (C) 2010-2020 Sameer Rahmani +;; +;; Author: Sameer Rahmani +;; Keywords: lisp fg42 IDE package manager +;; Version: 1.0.0 +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . +;; +;;; Commentary: +;;; Code: (add-to-list 'load-path (concat (getenv "HOME") ".fg42/lib")) (defvar bootstrap-version nil @@ -19,3 +42,6 @@ (load bootstrap-file nil 'nomessage)))) (fpkg-initialize) + +(provide 'build) +;;; build.el ends here diff --git a/lib/fpkg.el b/lib/fpkg.el index ea1cfb6..866e1d6 100644 --- a/lib/fpkg.el +++ b/lib/fpkg.el @@ -1,6 +1,6 @@ ;;; fpkg --- a simple package manager for FG42 -*- lexical-binding: t; -*- ;; -;; Copyright (C) 2010-2012 Sameer Rahmani +;; Copyright (C) 2010-2020 Sameer Rahmani ;; ;; Author: Sameer Rahmani ;; Keywords: lisp fg42 IDE package manager From a06bc3ecb1c97de169da45865c8c053183124de4 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 16 Mar 2020 21:39:03 +0000 Subject: [PATCH 29/29] Added explicit path change to build scripts of CI --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 64278bf..cdb7e39 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,15 +6,15 @@ build: stage: build before_script: - apt update && apt install -y make wget git emacs sudo - - git clone -b fpkg-v2 https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && cd + - git clone -b fpkg-v2 https://gitlab.com/FG42/FG42 ~/.fg42/ && cd ~/.fg42/ && make install && script: - - fg42 -nw --script build.el + - cd ~/.fg42/ && fg42 -nw --script build.el build-package: extends: build script: - - fg42 -nw --script build.el - - tar zcf fg42.$CI_COMMIT_TAG.tar.gz ~/.fg42/ + - cd ~/.fg42/ && fg42 -nw --script build.el + - cd && tar zcf fg42.$CI_COMMIT_TAG.tar.gz ~/.fg42/ artifacts: when: on_success paths: