Some things here might not be completely necessary or is not the typical way of doing it but is what worked for me.
- Do a regular install of drupal 7.
- Will need to use git-bash not git-cmd.
- Do an install of civicrm to get a working civicrm+drupal7 using the civicrm master tree from github plus civicrm-drupal and civicrm-packages. MAKE SURE YOU INSTALL CIVI IN A SEPARATE DATABASE, otherwise your drupal database will get wiped by this process.
- In the drupal root,
composer require drush/drush:^8.0
- Update path so that it can find that drush.
- Optionally update path so that it can find node_modules/karma/bin/karma. It's optional because otherwise it will try to install it again but that also works. It doesn't get used here anyway.
- Create bin/setup.conf from bin/setup.conf.txt. Note that you need GENCODE_CMS=Drupal not lower-case drupal as it suggests.
- CIVISOURCEDIR means path to sites/all/modules/civicrm.
- Hack bin/regen.sh to change
cms_eval 'civicrm_initialize();'
to
cd ../../../../..
cms_eval 'civicrm_initialize();'
cd $CIVISOURCEDIR/sql
Also change the line that contains `xargs` so it uses `xargs -d '\r'`.
- From sites/all/modules/civicrm, run
bin/regen.sh
- The sql/civicrm_generated.mysql file seems partly random, so to tell if it's working properly by comparing to the official release file is impossible. Although you can check the overall structure.
I also tried with drush in civi's vendor folder but it can't even do basic drush things from in there. It might work with a global install of drush.