Linux installing from github

Содержание
  1. Как пользоваться GitHub на компьютере с Linux
  2. Установка git
  3. Синтаксис
  4. Создание проекта на локальном компьютере
  5. Отправка данных на GitHub
  6. Создание репозитория
  7. Заливаем проект в репозиторий на GitHub
  8. Получение файлов с GitHub
  9. Клонирование проекта
  10. Возможные ошибки
  11. 1. При попытке отправить данные на GitHub, получаем ошибку:
  12. Git Guides
  13. Get started with git and GitHub
  14. Arch Linux
  15. #1 2018-10-11 09:31:18
  16. How to install a program from github
  17. #2 2018-10-11 10:26:11
  18. Re: How to install a program from github
  19. #3 2018-10-11 13:11:25
  20. Re: How to install a program from github
  21. #4 2018-10-11 13:25:01
  22. Re: How to install a program from github
  23. #5 2018-10-11 13:59:53
  24. Re: How to install a program from github
  25. #6 2018-10-11 14:31:24
  26. Re: How to install a program from github
  27. #7 2018-10-11 18:36:14
  28. Re: How to install a program from github
  29. #8 2018-10-12 10:33:35
  30. Re: How to install a program from github
  31. #9 2018-10-12 11:08:59
  32. Re: How to install a program from github
  33. #10 2018-10-12 11:39:39
  34. Re: How to install a program from github
  35. #11 2018-10-12 12:00:49
  36. Re: How to install a program from github
  37. #12 2018-10-12 12:46:48
  38. Re: How to install a program from github
  39. #13 2018-10-12 13:46:57
  40. Re: How to install a program from github
  41. #14 2018-10-12 13:54:18
  42. Re: How to install a program from github
  43. #15 2018-10-12 14:06:34
  44. Re: How to install a program from github
  45. #16 2018-10-12 14:12:35
  46. Re: How to install a program from github
  47. #17 2018-10-12 14:18:12
  48. Re: How to install a program from github
  49. #18 2018-10-12 14:34:30
  50. Re: How to install a program from github
  51. #19 2018-10-12 14:35:14
  52. Re: How to install a program from github
  53. #20 2018-10-12 14:47:06
  54. Re: How to install a program from github
  55. #21 2018-10-12 15:52:29
  56. Re: How to install a program from github
  57. #22 2018-10-13 08:17:48
  58. Re: How to install a program from github

Как пользоваться GitHub на компьютере с Linux

GitHub — один из используемых сервисов размещения проектов для совместной разработки. Он поддерживает контроль версий, возможность отслеживания изменений кода, сравнение строк, а также он бесплатен.

В данной статье приведены примеры использования сервиса на компьютере под управлением операционных систем семейства Linux. Мы рассмотрим, как создать проект на локальном компьютере и залить его на сервис с помощью командной строки. Рассмотренные варианты использования git также можно применять на desktop системах, запустив окно терминала.

Установка git

Управление выполняется с помощью приложения git. Если его нет в системе, установку можно выполнить из репозитория.

Если используем CentOS / Red Hat:

yum install git-core

Если используем Ubuntu / Debian:

apt-get install git

Если мы хотим воспользоваться сервисом с компьютера Windows или Mac OS, необходимо скачать и установить desktop версию с официального сайта.

Синтаксис

Команды имеют следующий синтаксис:

* полный перечень опций, команд и аргументов можно получить командой man git.

Создание проекта на локальном компьютере

Прежде чем отправить проект на GitHub, создаем его на нашем компьютере. Для этого переходим в каталог с файлами проекта:

Инициализируем проект для git:

Мы получим ответ похожий на:

Initialized empty Git repository in /projects/.git/

Это означает, что репозиторий git создан.

Теперь добавим файлы в репозиторий:

* данной командой мы добавили папку и ее содержимое в репозиторий git.

Отправка данных на GitHub

Теперь можно отправить данные на сервис. Для этого у нас должна быть зарегистрированная учетная запись и создан репозиторий на GitHub.

Создание репозитория

Переходим на портал github.com и входим в систему или проходим несложную регистрацию:

Проходим процесс подтверждения, что мы не робот. Затем завершаем несколько шагов регистрации, нажимая Submit. В итоге мы получим письмо на адрес электронной почты, которую указали при регистрации. Необходимо будем подтвердить email, перейдя в письме по кнопке Verify email address.

Создаем репозиторий. Для этого кликаем по иконке профиля и переходим в раздел Your repositories:

И кликаем по кнопке New. В следующем окне даем название репозиторию и нажимаем Create repository:

Мы увидим страницу с путем к репозиторию:

Заливаем проект в репозиторий на GitHub

Добавляем комментарий к нашему проекту:

git commit -m «Очередное изменение проекта» -a

* где Очередное изменение проекта — произвольный комментарий; параметр -a указывает, что комментарий нужно применить ко всем измененным файлам.

Теперь подключаемся к созданному репозиторию:

git remote add origin https://github.com/dmosktest/project1.git

* где dmosktest — логин, который был указан при регистрации на github, а project1 — название, которое мы задали, когда создавали репозиторий.
* удалить удаленный репозиторий можно командой git remote rm origin.

Закидываем проект на GitHub:

git push origin master

* где master — ветка проекта (веток может быть несколько).

В нашем проекте на GitHub должны появиться файлы проекта:

Получение файлов с GitHub

Для загрузки на компьютер файлов, создаем каталог с проектом и переходим в него:

Проводим начальную настройку локального репозитория:

Подключаемся к удаленному репозиторию:

git remote add origin https://github.com/dmosktest/project1.git

Скачиваем проект командой:

git pull https://github.com/dmosktest/project1.git master

Клонирование проекта

Например, использую наш репозиторий:

git clone https://github.com/dmosktest/project1.git

* данная команда создаст в текущей папке каталог project1 и инициализирует его как локальный репозиторий git. Также загрузит файлы проекта.

Возможные ошибки

1. При попытке отправить данные на GitHub, получаем ошибку:

error: src refspec master does not match any.
error: failed to push some refs to ‘https://github.com/dmosktest/project1.git’

* где dmosktest/project1.git — путь к нашему репозиторию.

Причина: проект ни разу не был зафиксирован (закоммичен).

Решение: добавляем комментарий к нашему проекту:

Источник

Git Guides

How to install Git on any OS

Git can be installed on the most common operating systems like Windows, Mac, and Linux. In fact, Git comes installed by default on most Mac and Linux machines!

Checking for Git

To see if you already have Git installed, open up your terminal application.

  • If you’re on a Mac, look for a command prompt application called «Terminal».
  • If you’re on a Windows machine, open the windows command prompt or «Git Bash».

Once you’ve opened your terminal application, type git version . The output will either tell you which version of Git is installed, or it will alert you that git is an unknown command. If it’s an unknown command, read further and find out how to install Git.

Install Git Using GitHub Desktop

Installing GitHub Desktop will also install the latest version of Git if you don’t already have it. With GitHub Desktop, you get a command line version of Git with a robust GUI. Regardless of if you have Git installed or not, GitHub Desktop offers a simple collaboration tool for Git. You can learn more here.

Install Git on Windows

  1. Navigate to the latest Git for Windows installer and download the latest version.
  2. Once the installer has started, follow the instructions as provided in the Git Setup wizard screen until the installation is complete.
  3. Open the windows command prompt (or Git Bash if you selected not to use the standard Git Windows Command Prompt during the Git installation).
  4. Type git version to verify Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git for Windows. The advantage of downloading Git from git-scm is that your download automatically starts with the latest version of Git included with the recommended command prompt, Git Bash . The download source is the same Git for Windows installer as referenced in the steps above.

Install Git on Mac

Most versions of MacOS will already have Git installed, and you can activate it through the terminal with git version . However, if you don’t have Git installed for whatever reason, you can install the latest version of Git using one of several popular methods as listed below:

Install Git From an Installer

  1. Navigate to the latest macOS Git Installer and download the latest version.
  2. Once the installer has started, follow the instructions as provided until the installation is complete.
  3. Open the command prompt «terminal» and type git version to verify Git was installed.

Note: git-scm is a popular and recommended resource for downloading Git on a Mac. The advantage of downloading Git from git-scm is that your download automatically starts with the latest version of Git. The download source is the same macOS Git Installer as referenced in the steps above.

Install Git from Homebrew

Homebrew is a popular package manager for macOS. If you already have Homwbrew installed, you can follow the below steps to install Git:

  1. Open up a terminal window and install Git using the following command: brew install git .
  2. Once the command output has completed, you can verify the installation by typing: git version .

Install Git on Linux

Fun fact: Git was originally developed to version the Linux operating system! So, it only makes sense that it is easy to configure to run on Linux.

You can install Git on Linux through the package management tool that comes with your distribution.

  1. Git packages are available using apt .
  2. It’s a good idea to make sure you’re running the latest version. To do so, Navigate to your command prompt shell and run the following command to make sure everything is up-to-date: sudo apt-get update .
  3. To install Git, run the following command: sudo apt-get install git-all .
  4. Once the command output has completed, you can verify the installation by typing: git version .
  1. Git packages are available using dnf .
  2. To install Git, navigate to your command prompt shell and run the following command: sudo dnf install git-all .
  3. Once the command output has completed, you can verify the installation by typing: git version .

Note: You can download the proper Git versions and read more about how to install on specific Linux systems, like installing Git on Ubuntu or Fedora, in git-scm’s documentation.

Читайте также:  Символы клавиш mac os

Other Methods of Installing Git

Looking to install Git via the source code? Learn more here.

Get started with git and GitHub

Review code, manage projects, and build software alongside 40 million developers.

Источник

Arch Linux

You are not logged in.

#1 2018-10-11 09:31:18

How to install a program from github

I am trying to install OpenFAST which is a multi-physics simulation code for (floating offshore) wind turbines. I have done as explained in the respective documentation:

So I am wondering, after building the program, how to actually install and make it executable. I have run the predecessor (FAST) on windows before. But back then it was just an .exe file to install. So I am struggling now how to actually install the program.

#2 2018-10-11 10:26:11

Re: How to install a program from github

#3 2018-10-11 13:11:25

Re: How to install a program from github

so obtaining, building and installing software from github could be divided into the following steps:

1. Obtaining source code from github
E.g. by

or by downloading the respective zipfile and unzipping it.
2. Build the package

3. Create the PKGBUILD
4. Make the package via makepkg
5. Install the package via pacman

But as far as I understood, I do not need to manually download the source from github. This can be written into PKGBUILD, correct? So I could skip 1. and 2. and just starting by creating the PKGBUILD?

What I don´ t understand here is the following from the Wiki creating packages:

Download the source tarball of the software you want to package, extract it, and follow the author’s steps to install the program. Make a note of all commands and/or steps needed to compile and install it. You will be repeating those same commands in the PKGBUILD file.

Most software authors stick to the 3-step build cycle:

This is a good time to make sure the program is working correctly.

I would already install the the program compiled by step 2. Or am I wrong? Thus, steps 3-5 are only necessary if I´ d like to provide a package with the respective software to other users e.g. to the AUR. But hereby I get confused because I learned that I should not install software to the system without using pacman.

Last edited by funkaddict (2018-10-11 13:22:29)

#4 2018-10-11 13:25:01

Re: How to install a program from github

1. Obtaining source code from github
2. Build the package
3. Create the PKGBUILD
4. Make the package via makepkg
5. Install the package via pacman

No. Step 1 is to make the PKGBUILD (using the github url for the source array and the comands to build in the build function). Step 2 is to build the package with makepkg which can also be given the -i flag to install the newly built package so there would be no step 3. If you don’t use the -i flag for makepkg, step 3 is to install it with pacman. There is never any need to directly download the source (makepkg does this) or run the build commands (makepkg also does this assuming you’ve written a build function).

This should be a very easy PKGBUILD to write, so it will be a good first experience with PKGBUILDs. If you provide a draft of your PKGBUILD here (in code tags) we can ensure you’ve got it right before you move on to step 2.

I would already install the the program compiled by step 2. Or am I wrong? Thus, steps 3-5 are only necessary if I´ d like to provide a package with the respective software to other users e.g. to the AUR. But hereby I get confused because I learned that I should not install software to the system without using pacman.

«Install» has two different meanings here. You should never directly run `sudo make install` in arch. That will copy the files to your root filesystem, but it will circumvent your package manager and it will almost certainly cause problems in the future (if no other problems, it may be hard to cleanly uninstall the software). Using a PKGBUILD is not just for sharing it with other users — rather using a PKGBUILD allows pacman to track your built package, prevent conflicts, and ease in managing (upgrading / uninstalling) the software.

Last edited by Trilby (2018-10-11 13:31:13)

«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman

#5 2018-10-11 13:59:53

Re: How to install a program from github

No. Step 1 is to make the PKGBUILD (using the github url for the source array and the comands to build in the build function). Step 2 is to build the package with makepkg which can also be given the -i flag to install the newly built package so there would be no step 3. If you don’t use the -i flag for makepkg, step 3 is to install it with pacman. There is never any need to directly download the source (makepkg does this) or run the build commands (makepkg also does this assuming you’ve written a build function).

This should be a very easy PKGBUILD to write, so it will be a good first experience with PKGBUILDs. If you provide a draft of your PKGBUILD here (in code tags) we can ensure you’ve got it right before you move on to step 2.

Thank you for the clarification. I will read and try to write the PKGBUILD.

«Install» has two different meanings here. You should never directly run `sudo make install` in arch. That will copy the files to your root filesystem, but it will circumvent your package manager and it will almost certainly cause problems in the future (if no other problems, it may be hard to cleanly uninstall the software). Using a PKGBUILD is not just for sharing it with other users — rather using a PKGBUILD allows pacman to track your built package, prevent conflicts, and ease in managing (upgrading / uninstalling) the software.

That makes sense and this coincides with what I have already learned about how to maintain Arch properly. I I have tried to ‘make install’ it yesterday, but without ‘sudo’ So luckily, I think I by this error, I did not cause any harm to the system, right? How can I check if there have been installed any packages going the unproper way?

#6 2018-10-11 14:31:24

Re: How to install a program from github

I have tried to ‘make install’ it yesterday, but without ‘sudo’ So luckily, I think I by this error, I did not cause any harm to the system, right?

Pretty much right. Assuming you were not logged in as root at the time, `make install` by itself can’t touch anything in your root filesystem. Most likely it would just fail to do anything, but this depends a bit on exactly what is in the makefile. Theoretically, the `make install` command could still have littered content around your user’s home folder, but if the makefile was generated by cmake as indicated above, then this is unlikely.

How can I check if there have been installed any packages going the unproper way?

That’s the problem, there is (was) no practical way to do this other than just exploring around in your root filesystem looking for anything odd. There is now a tool called `lostfiles` in [community] which is designed to find files not tracked by pacman. I don’t have direct experience with it, but the author of the tool is an active and knowledgeable archer.

EDIT: note about `lostfiles` — it will almost certainly provide false positives: do not just delete everything that it reports as untracked by pacman. Just consider them candidates for further investigation. Anything listed by `lostfiles` under /usr/bin would be particularly suspicious though; entries under /etc are more likely to be expected and should be left be; entries under /usr/share could be a mixed bag.

Last edited by Trilby (2018-10-11 14:52:27)

«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman

#7 2018-10-11 18:36:14

Re: How to install a program from github

but if the makefile was generated by cmake as indicated above, then this is unlikely.

Okay, that sounds plausible.

That’s the problem, there is (was) no practical way to do this other than just exploring around in your root filesystem looking for anything odd. There is now a tool called `lostfiles` in [community] which is designed to find files not tracked by pacman. I don’t have direct experience with it, but the author of the tool is an active and knowledgeable archer.

EDIT: note about `lostfiles` — it will almost certainly provide false positives: do not just delete everything that it reports as untracked by pacman. Just consider them candidates for further investigation. Anything listed by `lostfiles` under /usr/bin would be particularly suspicious though; entries under /etc are more likely to be expected and should be left be; entries under /usr/share could be a mixed bag.

I will have a look into ‘lostfiles’ just for curiousity. And will keep your suggestions in mind.

Tomorrow I will have the time to write the PKGBUILD. I want to be more certain what I am doing. I will post it here as soon as I finish it.

Читайте также:  Что такое hit windows

#8 2018-10-12 10:33:35

Re: How to install a program from github

So I have written the PKGBUILD and have plenty of questions

Is it better to remove these entries or just let the value blank (like I did)?

— I guess the pkgname should always be written without capital letters, correct?
— arch= I think this is not defined here anyway arch is only support x64. So ‘any’ is correct here?
— url= I think pkgname is sufficient, I don´ t need to call the versionnumber?
— licence= I found several examples regarding different licenses, but how to call the apache licence here?
— are the depends, makedepends and optdepends correct, when refering to OpenFAST Build instructions?
— I couldn´t find a md5sum for the package, but I think it makes sense to set this up. Is there another option to find this out?

Also I am wondering if I need an additional .install file. As far as I understood the PKGBUILD does define anything which is necessary to build the package.

#9 2018-10-12 11:08:59

Re: How to install a program from github

Is it better to remove these entries or just let the value blank (like I did)?

Remove what you do not need, empty variables clutter the PKGBUILD.

— I guess the pkgname should always be written without capital letters, correct?

Yes. If you use a git repository, then you should append «-git» as well

— arch= I think this is not defined here anyway arch is only support x64. So ‘any’ is correct here?

— url= I think pkgname is sufficient, I don´ t need to call the versionnumber?

— licence= I found several examples regarding different licenses, but how to call the apache licence here?

Since apache is part of the [core]/licenses package, you look for the name in /usr/share/licenses/common/, see «Apache» and use that.
https://wiki.archlinux.org/index.php/PKGBUILD#license

— I couldn´t find a md5sum for the package, but I think it makes sense to set this up. Is there another option to find this out?

You are mixing up a git build and a build from an archive with a specific release.
Do not clone the git repository in the build function. Use it as the source, create a pkgver() function to get the version from the git clone and append «-git» to your package name. https://wiki.archlinux.org/index.php/VC … guidelines

Alternatively use the archive for the tagged 1.0.0 release and set the checksum for it , preferably sha256sum.
https://wiki.archlinux.org/index.php/PKGBUILD#Integrity

Last edited by progandy (2018-10-12 11:53:53)

#10 2018-10-12 11:39:39

Re: How to install a program from github

pkgdesc shouldn’t contain pkgname in it, use something like wind turbine simulation code from US NREL

——————-
The versions in these dependencies can be omitted, archlinux is way ahead of those requirements.
Also it’s ok to put multiple depends on one line.

Check the build instructions section called «Current CMake options» .
The defaults for several options listed there are not what you/archlinux prefer.
example : shared libraries should be on by default

Given the imo questionable defaults upstream uses, I’d suggest you look into their CMakeLists.txt .
The choices you make will influence which deps are needed.

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can’t help you.

(A works at time B) && (time C > time B ) ≠ (A works at time C)

#11 2018-10-12 12:00:49

Re: How to install a program from github

I think I have included the relevant changes:

The following questions occur:

so do I have to include the package which I want to build as a dependent?

2. Did I define the depends correctly? I distinguished depends makedepends and optdepends in accordance to OpenFAST Build Instructions

3. The variable in

is pkgname but it is defined as openfast-git above. So an url pointing towards that package on github would not make any sense as https://github.com/OpenFAST/openfast-git does not exist but /openfast does. So should i define the url for the source absolute here?

Edit:
Refering to question #3, I found an option to use two different variables for the pkgname pkgname and pkgname as suggested here . Does this make sense?

Last edited by funkaddict (2018-10-12 12:36:27)

#12 2018-10-12 12:46:48

Re: How to install a program from github

Edit:
Refering to question #3, I found an option to use two different variables for the pkgname pkgname and pkgname as suggested here . Does this make sense?

It makes sense, but since you only need the name in the URLs, it doesn’t really matter. Both of these options are acceptable, but it is probably a good idea to also include provides and conflicts for the non-git version in case someone wants to upload that to the AUR.

Edit: And don’t append .tar.gz to the local name for the git repository.

Last edited by progandy (2018-10-12 12:49:44)

#13 2018-10-12 13:46:57

Re: How to install a program from github

Okay, so I think I am done with the PKGBUILD:

in case someone wants to upload that to the AUR.

Well I allways like to contribute as I really love the idea about open source and supporting each other. That´ s what me drove to move from windows to Ubuntu several years ago, to Manjaro two years ago and a couple of weeks ago finally to Arch. However, I think there is a very, very little user group for OpenFAST on Arch. The majority of the engineers/researchers, who are working in a field with a close connection to the industry still stick to windows. This applies also for the developers/users of FAST/OpenFAST.

I have tested the package using namcap:

I think that´ s okay? The hint concerning checksums can be skiped as this PKGBUILD is made to get the sources from github, right?

#14 2018-10-12 13:54:18

Re: How to install a program from github

This is a great start to a PKGBUILD — with a couple more revisions it should be ready to go.

1. There is no reason here to rename the local git repo in the source line (though it’s harmless). But you do need to specify either a git url or a git+https url:

2. Remove the empty epoch variable

3. Remove versioned depenencies as they are redundant on an arch system — occasionally versioned dependencies are needed to specify a depedence on a specific version or on a range of versions which are not currently in the arch repositories. But in arch `python` is python3 an thus implies ver > 3.0.0. And cmake in the repos is already *much* newer than the minimum required in your PKGBUILD.

«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman

#15 2018-10-12 14:06:34

Re: How to install a program from github

I have tested the package using namcap:

namcap will point out common mistakes. You should also see if makepkg succeeds in building the package though, preferably in a clean chroot.

You’re missing a makedep on git.

Checksums are required, you just set the checksum as ‘SKIP’, not leave out the variable.

For optdepends it’s nice to say why they might be needed.

#16 2018-10-12 14:12:35

Re: How to install a program from github

This is a great start to a PKGBUILD — with a couple more revisions it should be ready to go.

That´ s cool, thank to you and the others, supporting.

1. There is no reason here to rename the local git repo in the source line (though it’s harmless). But you do need to specify either a git url or a git+https url:

Ok, I have applied that. So I made a node to me to read/learn more about git

2. Remove the empty epoch variable

Don´ t know where this suddenly came up from again. Anyway, removed.

3. Remove versioned depenencies as they are redundant on an arch system — occasionally versioned dependencies are needed to specify a depedence on a specific version or on a range of versions which are not currently in the arch repositories. But in arch `python` is python3 an thus implies ver > 3.0.0. And cmake in the repos is already *much* newer than the minimum required in your PKGBUILD.

That makes a lot of sense. Thank You.

I assume I have to move the PKGBUILD into a directory with the name as defined in the PKGBUILD, so in this case this would be openfast-git and run makepkg here.

Last edited by funkaddict (2018-10-12 14:12:43)

#17 2018-10-12 14:18:12

Re: How to install a program from github

I assume I have to move the PKGBUILD into a directory with the name as defined in the PKGBUILD, so in this case this would be openfast-git and run makepkg here.

No, that’s not necessary, but also not a bad idea. It can be anywhere. When you retrieve a PKGBUILD from the aur this is what you will get, but this is just how the AUR is organized. The PKGBUILD can be anywhere (or anywhere you have write access) — you just need to run makepkg from the same directory as the PKGBUILD.

Of course this will create a few subdirectories and files there, so it is helpful to put the PKGBUILD in it’s own directory before running makepkg just to avoid cluttering any other location.

Last edited by Trilby (2018-10-12 14:18:42)

«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman

Читайте также:  Linux как узнать размер папки через консоль

#18 2018-10-12 14:34:30

Re: How to install a program from github

The PKGBUILD you posted will fail, but that failure is easy to solve.
Worse is that you ignored the most important part of #10, which will lead to an openfast installation with several disadvantages and very limited functionality.

I advise you to :

— take a long walk or other type of break
— once break is over, thoroughly read https://openfast.readthedocs.io/en/mast … linux.html atleast 2 times completely

If you don’t see the error in the build() function by now , run makepkg and solve the error.

tell us what things you’ll be missing in the software if you build with cmake default settings as set by upstream.

Last edited by Lone_Wolf (2018-10-12 14:48:41)

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can’t help you.

(A works at time B) && (time C > time B ) ≠ (A works at time C)

#19 2018-10-12 14:35:14

Re: How to install a program from github

I assume I have to move the PKGBUILD into a directory with the name as defined in the PKGBUILD, so in this case this would be openfast-git and run makepkg here.

No, that’s not necessary, but also not a bad idea. It can be anywhere. When you retrieve a PKGBUILD from the aur this is what you will get, but this is just how the AUR is organized. The PKGBUILD can be anywhere (or anywhere you have write access) — you just need to run makepkg from the same directory as the PKGBUILD.

Of course this will create a few subdirectories and files there, so it is helpful to put the PKGBUILD in it’s own directory before running makepkg just to avoid cluttering any other location.

Ok, but then I am wondering about

First I am moving to «$pkgname» which in this case is openfast-git then I am moving to OpenFAST. I think

is obsolete here, isn´t it?

And just to make sure that I have acutally understood what I am doing here:

When I run makepkg in, let´ s say /home/user/additionalpackages/openfast/ where the PKGBUILD is located, it will:

— download the source code:

— change directory into /home/user/additionalpackages/openfast/openfast

Last edited by funkaddict (2018-10-12 14:41:19)

#20 2018-10-12 14:47:06

Re: How to install a program from github

(yellow highlight will be removed once it’s clear funkaddict has noticed it)

The PKGBUILD you posted will fail, but that failure is easy to solve.
Worse is that you ignored the most important part of #10, which will lead to an openfast installation with several disadvantages and very limited functionality.

Indeed, I am sorry I overlooked the part below the strokes in #10

I advise you to :

— take a long walk or other type of break
— once break is over, thoroughly read https://openfast.readthedocs.io/en/mast … linux.html atleast 2 times completely

If you don’t see the error in the build() function by now , run makepkg and solve the error.

tell us what things you’ll be missing in the software if you build with cmake default settings as set by upstream.

I will do so, and will come back to the topic later. After getting my head clear

#21 2018-10-12 15:52:29

Re: How to install a program from github

Good plans above. There are still revisions to be made. For cd’ing in the build function, you can try out your PKGBUILD and your attention will first be drawn to the typo and/or missing characters in your source array, but once that is remedied, you can check the «src» folder that is created to see what is actually there: the source is under «openfast» which is $ <_pkgname>so you can just start the build (and package) functions with `cd «$<_pkgname>«`. [EDIT: note that the functions in the PKGBUILD all start in $srcdir which is — under standard configurations — the «src» directory created wherever you ran makepkg from.]

This may see like a long processes, but openfast for the most part follows standard installation processes; so once you understand how this PKGBUILD is made, you will be much more equipped to make others in the future. Eventually it becomes trivially easy to grab a PKGBUILD template, change a few things, and get a package built (assuming no quirks in the upstream source).

I’ll also note how well you are accepting some rather direct constructive criticism. Keep that up. I’m generally known around here for being quite abrasive, but I separate those who are willing and able to learn (as funkaddict is proving to be) versus the occasional user who is just lazy: the former just needs guidance, the latter are those I’ll show to the door . and give a few shoves in it’s direction.

Last edited by Trilby (2018-10-12 15:57:11)

«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman

#22 2018-10-13 08:17:48

Re: How to install a program from github

I have read the openfast install guide again, twice. What came into my mind was:

1. The depends were probably not accurate. So I moved hdf5 and yaml to optdepends, where I think they belong. And added make to the makedepends

2. In the build() function I removed the line

3. Furthermore I thought there should be added a line which reads

because this directory was never created in the PKGBUIILD. This should be done before the build() function as it is also necessary for pkgver(). So should I include a

. — Edit: As far as I understand now, this is not necessary.

4. I have to add the cmake build instructions as suggested by Lone_Wolf in Post #10. I assume BUILD_SHARED_LIBS — Enable building shared libraries (Default: OFF) to be of special importance here. Furthermore I added

out of curiousity and as I think the TESTING function makes sense and I want to try that.

5. Finally, I wonder that makepkg never gets the order to actually clone the source

. But when having a look into the AUR where different PKGBUILDs for several -github located packages can be found I see that this is not necessary.

Just to keep this up-to-date the current state of the PKGBUILD:

Which quits with an error that openfast wasn’t found in the build direcotry and is no URL

This may see like a long processes, but openfast for the most part follows standard installation processes; so once you understand how this PKGBUILD is made, you will be much more equipped to make others in the future. Eventually it becomes trivially easy to grab a PKGBUILD template, change a few things, and get a package built (assuming no quirks in the upstream source).

I’ll also note how well you are accepting some rather direct constructive criticism. Keep that up. I’m generally known around here for being quite abrasive, but I separate those who are willing and able to learn (as funkaddict is proving to be) versus the occasional user who is just lazy: the former just needs guidance, the latter are those I’ll show to the door . and give a few shoves in it’s direction.

I think learning is always a long process. And If I don’t want to learn, I’d say I am wrong with Arch Linux. As mentioned above, I went from windows, to ubuntu, to manjaro and now to arch. Because the other OS make it easy for users just go along without thinking what they actually do. So I am doing things, or let the scripts to things what I don’t have any idea how they work. Arch, from my beginner-like point of view makes the user to question things and be aware from what he is doing, right from the beginning. Just blind trusting into black-box like systems is not the way I like to go as this approach will cause problems, sooner or later.
There is a very well known commercial finite-element-method (FEM) software around. It’s licenses costs about 50-100.000US$ for a single pc. In a workshop (which additionally costs several thousand US$) how to use this software, a colleague asked the lecturer about a single function, which prevents freely floating objects, which have no, or at least not sufficient boundary conditions from disappearing into infinity. The lecturer answered that this is a feature of the program that the user doesn’t have to worry about these things. The problem is, that these so called «weak springs» are a black-box system where the user has no influence and no guidance how they even work. But they will have an influence on the results where nobody knows how big they will be. When one designs for example a floating substructure for wind turbines, one must really understand about the characteristics of a software and how the results are generated.
And you guys are spending time to help me learning and to understand how to achieve my goals with Arch. So there is nothing for me to complain, but only to appreciate your support.

As written above. It quits with an error that openfast wasn’t found in the build directory and is no URL. So I changed the source line:

Which solves the problem above and starts cloning from github but closes later with an error concerning integrity veryfication for: source

Last edited by funkaddict (2018-10-13 09:06:46)

Источник

Оцените статью