Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac Silicon build? #75

Open
boticello opened this issue Jul 22, 2021 · 3 comments
Open

Mac Silicon build? #75

boticello opened this issue Jul 22, 2021 · 3 comments

Comments

@boticello
Copy link

Could you make a binary available for Mac Silicon (ARM)?

I tried to build from source, but had the following error:

Free Pascal Compiler version 3.2.2 [2021/06/03] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Darwin for x86_64
Compiling xidel.pas
xidel.pas(33,6) Fatal: Can't find unit internetaccess used by xidel
Fatal: Compilation aborted
Error: /opt/homebrew/bin/ppcx64 returned an error exitcode

I had installed fpc--3.2.2.arm64_big_sur.bottle.tar.gzvia homebrew.

@Reino17
Copy link

Reino17 commented Jul 23, 2021

I tried to build from source...

If that source is only https://github.com/benibela/xidel.git, then the error is expected.
Better to use the SourceForge repository instead, which, except for FLRE, has all the necessary components.

$ hg clone http://hg.code.sf.net/p/videlibri/code videlibri-code_hg
$ git clone https://github.com/benibela/flre.git flre_git

$ cd videlibri-code_hg/

$ echo "writeln('($(hg log -l 1 -T '{date|shortdate}.{rev}.{node|short}' | tr -d '-'))');" > programs/internet/xidel/xidelbuilddata.inc

$ fpc -O3 -Cort -CX -XX -Xs -dUSE_SYNAPSE_WRAPPER \
-FEprograms/internet/xidel \
-Fucomponents/pascal/internet \
-Fucomponents/pascal/data \
-Ficomponents/pascal/data \
-Fu../flre_git/src \
-Fucomponents/pascal/system \
-Fucomponents/pascal/import/synapse \
-Ficomponents/pascal/import/synapse \
-Fuprograms/internet/xidel \
-Fiprograms/internet/xidel \
programs/internet/xidel/xidel.pas

It is possible to compile xidel from all the Github sources, but as the "Synapse OpenSSL initialization" can still only be found on SourceForge, you do still need it. I've asked Benito if he could copy the "Synapse OpenSSL initialization" to Github as well, but he hasn't responded.

$ git clone https://github.com/benibela/xidel.git xidel_git
$ git clone https://github.com/benibela/internettools.git internettools_git
$ git clone https://github.com/benibela/flre.git flre_git
$ git clone https://github.com/benibela/rcmdline.git rcmdline_git
$ hg clone http://hg.code.sf.net/p/videlibri/code videlibri-code_hg

$ cd xidel_git/

Now, the creation of 'xidelbuilddata.inc' is personal and a matter of taste. I use this exotic command...

$ echo -e "writeln('$(git describe --tags | sed 's/_/ /')-openssl    ($(git log -1 --date=format:%Y%m%d --pretty=format:%cd))');\nwriteln('  $(git --git-dir=../internettools_git/.git describe --tags | sed 's/VIDELIBRI_/internettools /') ($(git --git-dir=../internettools_git/.git log -1 --date=format:%Y%m%d --pretty=format:%cd))');\nwriteln('  $(git --git-dir=../rcmdline_git/.git describe --tags | sed 's/Xidel_/rcmdline         /') ($(git --git-dir=../rcmdline_git/.git log -1 --date=format:%Y%m%d --pretty=format:%cd))');\nwriteln('  flre                    g$(git --git-dir=../flre_git/.git rev-parse --short HEAD) ($(git --git-dir=../flre_git/.git log -1 --date=format:%Y%m%d --pretty=format:%cd))');" > xidelbuilddata.inc

$ cat xidelbuilddata.inc
writeln('Xidel 0.9.8-97-g6d3b344-openssl    (20210720)');
writeln('  internettools 2.180-219-g57263ab (20210720)');
writeln('  rcmdline         0.7-21-gd8b69ae (20201228)');
writeln('  flre                    g0dfdae7 (20210412)');

...and apply the following change...

$ cat ../remove_getVersionString.diff
diff --git a/xidelbase.pas b/xidelbase.pas
index 42773be..f76af2a 100644
--- a/xidelbase.pas
+++ b/xidelbase.pas
@@ -3331,21 +3331,12 @@ begin
   end;
 end;
 
-function getVersionString: string;
-begin
-  result := IntToStr(majorVersion)+'.'+IntToStr(minorVersion);
-  if buildVersion <> 0 then result += '.'+IntToStr(buildVersion);
-  if Result = '0.8.4' then result += ' (Balisage edition)'
-end;
-
 procedure printVersion;
 begin
-  writeln('Xidel '+getVersionString);
   {$I xidelbuilddata.inc} //more version information to print. if you do not have the file, just create an empty one or remove this line
-  writeln('');
+  writeln();
   writeln('http://www.videlibri.de/xidel.html');
   writeln('by Benito van der Zander <[email protected]>');
-  writeln();
 end;
 
 procedure printUsage;
@@ -3643,7 +3634,7 @@ begin
   mycmdline.declareFlag('deprecated-string-options', 'Replaces the old $foo; variables with the new {$foo} in arguments');
   mycmdline.declareFlag('deprecated-trim-nodes', 'Removes all surrounding white space of all nodes.');
 
-  mycmdLine.declareFlag('version','Print version number ('+getVersionString+')');
+  mycmdLine.declareFlag('version','Print version number');
   mycmdLine.declareFlag('usage','Print help, examples and usage information');
   mycmdLine.declareFlag('quiet','-quiet,-q is outdated. Use --silent,-s', 'q');
 
patch -p1 < ../remove_getVersionString.diff
$ fpc -O3 -Cort -CX -XX -Xs -dUSE_SYNAPSE_WRAPPER \
-FE. \
-Fu../internettools_git/internet \
-Fu../internettools_git/data \
-Fi../internettools_git/data \
-Fu../rcmdline_git \
-Fu../flre_git/src \
-Fu../videlibri-code_hg/components/pascal/import/synapse \
-Fi../videlibri-code_hg/components/pascal/import/synapse \
xidel.pas

[...]

$ ./xidel --version
Xidel 0.9.8-97-g6d3b344-openssl    (20210720)
  internettools 2.180-219-g57263ab (20210720)
  rcmdline         0.7-21-gd8b69ae (20201228)
  flre                    g0dfdae7 (20210412)

http://www.videlibri.de/xidel.html
by Benito van der Zander <[email protected]>

@benibela
Copy link
Owner

benibela commented Jul 24, 2021

I've asked Benito if he could copy the "Synapse OpenSSL initialization" to Github as well, but he hasn't responded.

I had put it here: https://github.com/benibela/ararat-synapse/

Now, the creation of 'xidelbuilddata.inc' is personal and a matter of taste. I use this exotic command...

Now that will just confuse people

@Reino17
Copy link

Reino17 commented Jul 25, 2021

I'd disagree. It perfectly sums up the snapshots of the integrated / required components. And the g in front of the commit hash means Github of course.

What actually is confusing in my opinion is the fact that you build / release xidel from a private repository, resulting in a different revision number and commit hash compared to http://hg.code.sf.net/p/videlibri/code.

$ xidel --version
Xidel 0.9.9
(20210720.7961.2e0374a546a6)

$ hg -R videlibri-code_hg log -l 1 -T '{date|shortdate}.{rev}.{node|short}' | tr -d '-'
20210720.6547.5041ce265dac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants